Bug: Double Apostrophe in <value> URI Formatting Issue
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript
- Ambito
- tooling
Direzione di ricerca
Nell'issue non sono indicati né un file sorgente né un test. Inizia riproducendo l'esempio XML con Prettier e @prettier/plugin-xml, quindi individua il formatter XML e i relativi test di regressione esistenti. Il lavoro è completato quando le entità 6apos; adiacenti vengono formattate senza inserire uno spazio, preservando il comportamento segnalato per gli altri testi XML.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description:
I encountered a problem with the @prettier/plugin-xml plugin. When an XML file contains the text:
<value>''</value>
Prettier rewrites it as:
<value>
' '
</value>
This formatting adds an unwanted space between the apostrophes, which disrupts the appearance of our system.
Steps to Reproduce:
- Create an XML file with the following content:
<root> <value>''</value> </root> - Run Prettier with the @prettier/plugin-xml plugin.
- Observe the formatted output.
Expected Behavior:
The content of the <value> tag should remain <value>''</value> without adding spaces.
Actual Behavior:
The content of the <value> tag is rewritten as:
<value>
' '
</value>
Additional Information:
In other cases, when there is only one apostrophe, Prettier formats correctly by keeping the line together:
<values>
<field>ITA_IFM_ActivityDescription__c</field>
<value xsi:type="xsd:string">MEDIA COMPLESSITA'</value>
</values>
This leads us to believe it is a minor bug. Could you please provide feedback?
Prettier Configuration:
{
"plugins": ["prettier-plugin-apex", "@prettier/plugin-xml"],
"printWidth": 600,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": false,
"useTabs": true,
"bracketSameLine": true,
"apexInsertFinalNewline": false,
"overrides": [
{
"files": "*.{trigger,cls}",
"options": {"parser": "apex"}
},
{
"files": "*.{apex}",
"options": {"parser": "apex-anonymous"}
},
{
"files": "**/lwc/**/*.html",
"options": {"parser": "lwc"}
},
{
"files": "*.{cmp,page,component,evt}",
"options": {
"parser": "html",
"trailingComma": "none"
}
},
{
"files": "**/aura/**/*.js",
"options": {"trailingComma": "none"}
},
{
"files": "**/aura/**/*.{auradoc,design,app}",
"options": {"parser": "angular"}
},
{
"files": "**/*.xml",
"options": {
"parser": "xml",
"useTabs": false,
"tabWidth": 4,
"xmlWhitespaceSensitivity": "preserve",
"embeddedLanguageFormatting": "off",
"xmlSelfClosingSpace": false
}
}
]
}
and this is our package.json
{
"name": "***",
"version": "1.0.0",
"author": "***",
"devDependencies": {
"@prettier/plugin-xml": "^3.4.1",
"prettier": "^3.4.2",
"prettier-plugin-apex": "^2.2.2"
},
"repository": {
"type": "****",
"url": "****"
},
"scripts": {
"prettier": "prettier"
},
"dependencies": {
"sfdx-plugin-source-read": "^1.4.0"
}
}
Thanks in advice, i'm here if you need anything else 😊
- Lingua principale
- JavaScript
- Stelle
- 278
- Fork
- 46
- Merge medio
- 1m
- PR unite (30g)
- 13
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di prettier/plugin-xml
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
prettier/plugin-xml#996 ·
-
Incorrect indentation with xmlWhitespaceSensitivity "preserve" inside a sibling of a text node Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
prettier/plugin-xml#995 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
prettier/plugin-xml#986 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
prettier/plugin-xml#981 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
prettier/plugin-xml#937 · 1 reazione ·
Tutte le issue di prettier/plugin-xml
Issue simili
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Improve Title Support Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·