markdown: Unicode punctuation, whitespace and label case folding from the tables (slice of #366) #375
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Part of #366 (declarations: #373).
std/markdown/src/text.trbkeeps TorbScript tables for what CommonMark asks of Unicode:isPunctuation(the categories P and S) over a list of blocks,isSymbolOfLetterlike,isUnicodeWhitespace, and the case folding of link labels (folded) over ASCII-and-Greek-and-Cyrillic (TEXT-FORMATS.md). The spec defines all three from the Unicode data, so the tables are replaced by it.Depends on
The
std/textdeclarations of #373 (Char.category(),GeneralCategory,String.toCaseFolded()), merged. Independent of #374.Decisions (refinement)
category().isPunctuation() || category().isSymbol()(CommonMark: the categories P and S), with the existing ASCII fast path kept. Unicode whitespace isSpaceSeparatoror tab, line feed, form feed, carriage return.String.toCaseFolded()(the full folding the spec's "Unicode case fold" means:ẞandßfold toss), nottoLowerCase(). The order of the steps stays as it is today.isAsciiPunctuation,isAsciiLetter,isSpaceOrTabare not Unicode tables and stay.Acceptance criteria
isPunctuation,isUnicodeWhitespaceandnormalizedLabeluse the natives above;isSymbolOfLetterlike,foldedand every block list ofstd/markdown/src/text.trbare deleted.std/markdown/tests/spec.test.trb; the PR states the count from CI), and the writer's tests are unchanged.₿U+20BF), a label that matches across case in Armenian, Cherokee and Georgian ([ԱԲ]against a definition[աբ]),[ẞ]against[SS], a no-break space and an ideographic space as Unicode whitespace.docs/design/TEXT-FORMATS.md(the bullet "Unicode punctuation ... are TorbScript tables") and the markdown page ofdocs/standard-library/say the data is the Unicode tables; skills regenerated.Seed impact
None:
std/markdownonly.Size
One PR, one Conventional Commit:
feat(markdown): Unicode punctuation, whitespace and label folding from the tables.[loop:torbscript] refine: body written by the refinement of #366 (decisions: P or S via the category, labels folded with
String.toCaseFolded()). next: waiting (depends on #373 merged)