plugin-xml icon indicating copy to clipboard operation
plugin-xml copied to clipboard

Feature Request: smart quote styles

Open merlinz01 opened this issue 3 months ago • 0 comments

Could we have an option like "xmlQuoteAttributes": "least_escape" that auto-detects the best quote style for the attribute based on how many of each quotation character is found in the value?

That way we can use quotation marks in values and still have it be readable.

bracketSameLine

None

printWidth

120

singleAttributePerLine

false

tabWidth

2

xmlWhitespaceSensitivity

ignore

xmlSelfClosingSpace

true

Input XML

<div class='row'>
  <div class='col-1' />
  <div class='col-9 ps-4' t-field='o.partner_id.name' />
  <div class='col-2' t-out="f'{o.amount:.2f}'" />
</div>

Current output XML

<div class='row'>
  <div class='col-1' />
  <div class='col-9 ps-4' t-field='o.partner_id.name' />
  <div class='col-2' t-out='f&apos;{o.amount:.2f}&apos;' />
</div>

~~Expected~~ Desired output XML

<div class='row'>
  <div class='col-1' />
  <div class='col-9 ps-4' t-field='o.partner_id.name' />
  <div class='col-2' t-out="f'{o.amount:.2f}'" />
</div>

merlinz01 avatar Oct 06 '25 19:10 merlinz01