Bug: Double Apostrophe in <value> URI Formatting Issue
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- javascript
- 領域
- tooling
調査の方向性
issue ではソースファイルもテストも指定されていません。まず Prettier と @prettier/plugin-xml を使って XML の例を再現し、次に XML formatter と既存の回帰テストを見つけてください。隣接する 6apos; エンティティをスペースを挿入せずにフォーマットし、その他の XML テキストについて報告された動作を維持できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
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 😊
- 主要言語
- JavaScript
- スター
- 278
- フォーク
- 46
- 平均マージ
- 1分
- マージ済み PR(30日)
- 13
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
prettier/plugin-xml のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
prettier/plugin-xml#996 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
prettier/plugin-xml#995 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
prettier/plugin-xml#986 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
prettier/plugin-xml#981 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
prettier/plugin-xml#937 · リアクション 1 件 ·
prettier/plugin-xml の issue をすべて見る
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Mend: dependency security vulnerability untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100