Introduce initialIndentationLevel option for the XMLBuilder
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- tooling
調査の方向性
issue で説明されている XMLBuilder の初期化から始めてください。現在、インデントレベルは 0 に固定されています。提案された PR NaturalIntelligence/fast-xml-parser#566 を確認してください。完了条件は、デフォルトの出力を維持しながら initialIndentationLevel をサポートし、挿入された trans-unit の内容を正しくインデントできることです。
索引モデルが issue の本文から書いたものです。
説明
Hello there! I’ve started using XMLParser/XMLBuilder in my project markdown-translation and arrived at use case that is not really supported in the XMLBuilder.
First i render XML template/wrapper which makes skeleton base of the rendered document with {format: true} options.
example of the generated template:
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="file.md" source-language="ru-RU" target-language="en-US" datatype="markdown">
<header>
<skeleton>
<external-file href="file.skl.md"></external-file>
</skeleton>
</header>
<body>
<!-- split point -->
</body>
</file>
</xliff>
After rendering template i split it at the <!-- split point --> so that later i can dynamically render <trans-unit></trans-unit> with content inside the body tag.
The problem is that later when i render each trans-unit tag XMLBuilder unaware of the fact that trans-unit tag is going to be injected into other document(template) at the level: 3 point of indentation.
Result is going to be something like this:
<?xml version="1.0" encoding="UTF-8"?>
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2">
<file original="file.md" source-language="ru-RU" target-language="en-US" datatype="markdown">
<header>
<skeleton>
<external-file href="file.skl.md"></external-file>
</skeleton>
</header>
<body>
<trans-unit>
<source>str</source>
<target>target</target>
</trans-unit>
</body>
</file>
</xliff>
Hence i propose the solution - Introduce new option initialIndentationLevel and initialize builder with it instead of the literal value 0.
The option initialIndentationLevel is going to default to 0 so that default behaviour will be preserved.
Yet will allow my use case and generally make it more convenient building part of the XML document in the pretty format.
Please let me know what you think about it.
There is already PR for this feature: NaturalIntelligence/fast-xml-parser#566.
Would you like to work on this issue?
- Yes
- No
- 主要言語
- JavaScript
- スター
- 22
- フォーク
- 9
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NaturalIntelligence/fast-xml-builder のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
-
`preserveOrder: true` with `format: true` formats mixed content wrongly and adds whitespace to content that ends with `>`対応中かも @neumaennl が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
`XMLBuilder` object should be exported as a named export, not just the type対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NaturalIntelligence/fast-xml-builder#25 · コメント 1 件 ·
-
sanitizeName not applied to names inside stopNodes (quote injection / tag break-out bypass)対応中かも @hicay が 5 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
NaturalIntelligence/fast-xml-builder#34 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 54/100
NaturalIntelligence/fast-xml-builder の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
Extended search drops any query term that contains a line break対応中かも @goranai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
area:mcp
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信