Heading ids: adopt jgm/djot # 393 (case + non-ASCII preserved) - #72
Merged
Conversation
Re-vendor carve-lib from the #393 carve-js build and regenerate the heading-id corpus examples. Auto ids now preserve letter case and all non-ASCII characters, replace each maximal run of non-alphanumeric ASCII with a single '-', and use an 's-' prefix for a leading digit (previously lowercase + ASCII-fold + 'section-'). Add a NORMATIVE heading-identifier rule to resources/grammar.ebnf and update the case-study and feature docs. ASCII folding becomes an opt-in implementation mode (carve-js 'asciiHeadingIds' parse option; carve-php 'AsciiHeadingIdsExtension'). Part of the heading-id slug resolution (#71).
dereuromark
added a commit
that referenced
this pull request
Jun 6, 2026
#73) #72 adopted jgm/djot#393's case-preserving ids, but case preservation broke </#id> cross-references: a lowercase ref no longer matched a case-preserved id (e.g. `# Getting Started` -> `Getting-Started`, so `</#getting-started>` failed). Switch carve to LOWERCASE (Unicode-aware; non-ASCII characters preserved, only their case folded) - the GitHub/SSG convention authors expect for anchors, which makes ids and the common cross-reference case-insensitive with no special lookup. Re-vendor the lowercase carve-lib, regenerate the heading-id corpus examples, and update the normative grammar rule + case-study/feature docs. carve now deliberately diverges from djot-php (case-preserving per #393); both keep the opt-in ASCII fold (carve-js asciiHeadingIds; carve-php AsciiHeadingIdsExtension). Refs #71.
dereuromark
added a commit
that referenced
this pull request
Jun 7, 2026
Re-vendor carve-lib from the #393 carve-js build and regenerate the heading-id corpus examples. Auto ids now preserve letter case and all non-ASCII characters, replace each maximal run of non-alphanumeric ASCII with a single '-', and use an 's-' prefix for a leading digit (previously lowercase + ASCII-fold + 'section-'). Add a NORMATIVE heading-identifier rule to resources/grammar.ebnf and update the case-study and feature docs. ASCII folding becomes an opt-in implementation mode (carve-js 'asciiHeadingIds' parse option; carve-php 'AsciiHeadingIdsExtension'). Part of the heading-id slug resolution (#71).
dereuromark
added a commit
that referenced
this pull request
Jun 7, 2026
#73) #72 adopted jgm/djot # 393's case-preserving ids, but case preservation broke </#id> cross-references: a lowercase ref no longer matched a case-preserved id (e.g. `# Getting Started` -> `Getting-Started`, so `</#getting-started>` failed). Switch carve to LOWERCASE (Unicode-aware; non-ASCII characters preserved, only their case folded) - the GitHub/SSG convention authors expect for anchors, which makes ids and the common cross-reference case-insensitive with no special lookup. Re-vendor the lowercase carve-lib, regenerate the heading-id corpus examples, and update the normative grammar rule + case-study/feature docs. carve now deliberately diverges from djot-php (case-preserving per #393); both keep the opt-in ASCII fold (carve-js asciiHeadingIds; carve-php AsciiHeadingIdsExtension). Refs #71.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adopts the settled jgm/djot # 393 rule for
auto-generated heading ids in the carve spec, mirroring the same change already made
in djot-php (php-collective/djot#224).
Change
Auto heading ids now preserve letter case and all non-ASCII characters: replace
each maximal run of non-alphanumeric ASCII with a single
-, trim, and prefixs-for a leading digit. Previously they were lowercased, ASCII-transliterated, and used
a
section-prefix.# Getting Startedgetting-startedGetting-Started# Über unsuber-unsÜber-uns# 2024 Recapsection-2024-recaps-2024-Recap# 日本語日本語日本語What's in this PR
docs/examples.mdheading examples regenerated → corpustests/corpus+tests/specupdated (12 heading pairs).resources/grammar.ebnf: new NORMATIVE heading-identifier rule.case-study/syntax.md"Automatic Identifiers" rewritten; feature-analysis note updated.ASCII folding becomes an opt-in implementation mode (carve-js
asciiHeadingIdsparse option; carve-php
AsciiHeadingIdsExtension) — never the default.Resolves the spec side of #71
This is step 1 of 3 for #71. The
matching impl PRs (carve-js
feat/heading-ids-393; carve-php pending) land after this,then #71 closes. Conformance suite green (196 pass, 2 pre-existing skips).