Skip to content

Feature Request: smart quote styles #937

Description

@merlinz01

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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions