Control characters in run text are deleted on save, so Segment.BeginOffset and run boundaries shift after reload
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 54/100
調査の方向性
Start by reading StripInvalidXmlChars in TsStringSerializer and TsStringUtils.NormalizeNfd(ITsString), then compare the suggested behavior with #414. Run the named ControlCharacterOffsetDesyncTests and the TsStringSerializerTests round-trip to confirm the offset shift. Done means serialization and normalization preserve text length by replacing invalid XML characters with U+FFFD, or the chosen input policy is covered by tests.
索引モデルが issue の本文から書いたものです。
説明
Characters XML cannot store (U+0000–U+0008, U+000B, U+000C, U+000E–U+001F, U+FFFE, U+FFFF) are accepted by the model, but TsStringSerializer silently deletes them on write (StripInvalidXmlChars). After reload, anything that stores a character index into the text points at the wrong character.
Repro (master 0bc98fb0, net462 and net8.0):
- Take a paragraph
One a<U+0001>b two. Three four.whose second segment hasBeginOffset13 ("Three"). Save, close and reopen the project. The text is now 23 characters instead of 24, andBeginOffset13 points at "hree ". The next parse or edit misplaces analyses. - The same happens with a plain string: runs
ab<U+0001>cd(en) +EFGH(es) serialize and deserialize with the es run starting at 4 instead of 5.
ktptOffset is not affected: it is a baseline shift in millipoints, not a character index.
Suggested fix: make writes length-preserving by replacing these characters with U+FFFD instead of deleting them, and apply the same replacement at input in TsStringUtils.NormalizeNfd(ITsString). This is the approach #414 takes for lone surrogates. Whether to replace them or reject them at input is a maintainer decision. Failing tests are ready (ControlCharacterOffsetDesyncTests, and a TsStringSerializerTests round-trip) and can come with the fix PR.
Related: #409, #412, #414.
- 主要言語
- C#
- スター
- 3
- フォーク
- 15
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sillsdev/liblcm のほかの issue
-
Saving run text that contains a lone (unpaired) surrogate throws in TsString normalization対応中かも @johnml1135 が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
-
Text props: an unknown writing-system handle is saved as ws="", which no reader can load対応中かも @johnml1135 が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
Text property XML: writer emits properties and values its own reader rejects (record fails to load)対応中かも @johnml1135 が 1 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
-
DeepWiki-found bugsオープン
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
sillsdev/liblcm の issue をすべて見る
似ている issue
-
needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
Azure/azure-sdk-for-net#64658 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dotnet/aspnetcore#70370 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NethermindEth/nethermind#15684 ·
メンテナーはふだん 1 日以内に返信
-
area/ai-assistant squad/flyt
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Altinn/altinn-studio#21798 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
SubtitleEdit/subtitleedit#16699 ·
メンテナーはふだん 1 日以内に返信