Bug: Double Apostrophe in <value> URI Formatting Issue
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Issue không nêu tên tệp nguồn hoặc test nào. Hãy bắt đầu bằng cách tái hiện ví dụ XML với Prettier và @prettier/plugin-xml, sau đó tìm XML formatter và các regression test hiện có của nó. Được xem là hoàn tất khi các entity 6apos; liền kề được format mà không chèn thêm khoảng trắng, đồng thời vẫn giữ nguyên hành vi đã báo cáo đối với văn bản XML khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 😊
- Ngôn ngữ chính
- JavaScript
- Star
- 278
- Fork
- 46
- Merge trung bình
- 1 phút
- Pull request đã merge (30 ngày)
- 13
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của prettier/plugin-xml
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
prettier/plugin-xml#996 ·
-
Incorrect indentation with xmlWhitespaceSensitivity "preserve" inside a sibling of a text node Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
prettier/plugin-xml#995 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
prettier/plugin-xml#986 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 55/100
prettier/plugin-xml#981 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
prettier/plugin-xml#937 · 1 reaction ·
Tất cả issue của prettier/plugin-xml
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Issue-Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sugarlabs/musicblocks#8924 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
ArduPilot/ardupilot_wiki#8088 ·
-
[BUG] createTool tools cannot be registered with Mastra when exactOptionalPropertyTypes is enabled Đang mởcustomer-eng status: needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100