Whitespace is incorrectly preserved when `xmlWhitespaceSensitivity` is set to `ignore`
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 42/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- tooling
調査の方向性
XML プラグインの実装で xmlWhitespaceSensitivity と、現在の String#trim または \s ベースの処理を検索します。タブ、改行、スペース、および一覧にある XML 以外の空白文字を含む XML テキストで動作を再現します。sensitivity が ignore に設定されている場合に、タブ、改行、復帰、スペースだけがトリミングされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
According to the XML specification, only \t, \n, \r, and (space character) are considered whitespace and are affected by the xml:space attribute. As it has been already raised in #768, the plugin used String#trim() to remove whitespace characters, affecting also other non-XML whitespace characters:
- U+00A0 No-Break Space
- U+1680 Ogham Space Mark
- U+2000 En Quad
- U+2001 Em Quad
- U+2002 En Space
- U+2003 Em Space
- U+2004 Three-Per-Em Space
- U+2005 Four-Per-Em Space
- U+2006 Six-Per-Em Space
- U+2007 Figure Space
- U+2008 Punctuation Space
- U+2009 Thin Space
- U+200A Hair Space
- U+2028 Line Separator
- U+2029 Paragraph Separator
- U+202F Narrow No-Break Space
- U+205F Medium Mathematical Space
- U+3000 Ideographic Space
- U+FEFF Zero Width No-Break Space
This issue has been fixed in 6170e95. However, the fix still affects most of the characters mentioned above due to the usage of the \s character class and the issue described originally in #768 still persists.
Probably the easiest way to fix the issue is to replace the \s character class with the (space character):
const content = chardata.TEXT.replaceAll(/^[\t\n\r ]+|[\t\n\r ]+$/g, "");
- 主要言語
- 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
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
georgestephanis/p2026#40 ·
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Margaret-Petersen/food-delivery-app-clone-react-native#1981 ·