Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Whitespace is incorrectly preserved when `xmlWhitespaceSensitivity` is set to `ignore`

オープン
#789 コメント 0 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
42/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript
領域
tooling

調査の方向性

XML プラグインの実装で xmlWhitespaceSensitivity と、現在の String#trim または \s ベースの処理を検索します。タブ、改行、スペース、および一覧にある XML 以外の空白文字を含む XML テキストで動作を再現します。sensitivity が ignore に設定されている場合に、タブ、改行、復帰、スペースだけがトリミングされれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

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:

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

prettier/plugin-xml のほかの issue

prettier/plugin-xml の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。