Skip to content
This repository was archived by the owner on Nov 7, 2026. It is now read-only.

Write invisible characters as references and NBSP as   (#172) - #176

Merged
johnml1135 merged 1 commit into
mainfrom
md/spaces-invisibles
Nov 6, 2026
Merged

johnml1135 merged 1 commit into
mainfrom
md/spaces-invisibles

Conversation

@johnml1135

Copy link
Copy Markdown
Collaborator

Start here: src/SIL.TextEditing.Markdown/Chars.cs (IsInvisible, JoinsEmoji) and the two-line change in Writer/InlineGenerator.cs.

Invisible format characters (ZWSP, ZWNJ, ZWJ, WJ, SHY, LRM/RLM/ALM, bidi embeddings/overrides/isolates, invisible operators, MVS, CGJ) were written literally: lossless, but nobody editing the Markdown could see them. Real FieldWorks projects hold them (154 LRM, 13 ZWSP, 2 SHY across the DistFiles sample projects). They are now numeric references; a ZWJ joining two emoji stays literal; NBSP is written  . The reader (Markdig) and Pandoc 3.9 read both spellings to the same characters, so files already written still read.

Evidence: new conformance cases in tests/conformance/03-escapes.json (writer output, round trip and Pandoc agreement); spec updated in docs/formats/fieldworks-markdown.md. Full suite green on net10.0 and net48.

Edge spaces: decided against changing the format

The "typing convention" (a plain space after a span takes the span's writing system) was measured on the real projects in FieldWorks DistFiles/Projects: it would cut   escapes only from 2,405 to 2,242 (7%), because embedded words have one space typed in each writing system. Edge spaces stay  .

Next: show invisible characters in the WYSIWYG field the way Paratext 9.5 does (research in progress).

Part of sillsdev/motif#58.

🤖 Generated with Claude Code

Zero-width space, the joiners, word joiner, soft hyphen, LRM/RLM/ALM, bidi
embeddings, overrides and isolates, the invisible operators, the Mongolian
vowel separator and the combining grapheme joiner were written literally:
kept, but invisible to a person or an agent editing the Markdown. They are
now numeric references. A zero-width joiner between two emoji stays literal.
A no-break space is written  . The reader already took both spellings;
Pandoc reads them to the same characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@johnml1135
johnml1135 merged commit 5ccc64b into main Nov 6, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant