feat(parser): opt-in typographic smart punctuation#42
Merged
Conversation
3f6f625 to
bd496ea
Compare
MarkdownComposer.builder().smartPunctuation(true) enables flexmark-ext-typographic: straight quotes become curly quotes (nested formatting inside the quotes survives via TypographicQuotes flattening in the mapper), -- an en-dash, --- an em-dash, ... an ellipsis. Off by default — GitHub does not smart-quote, so default output is byte-identical — and code spans/blocks stay verbatim. Replacement characters ride the existing HTML-entity decoder; curly-quote and guillemet entities added to NAMED_ENTITIES. Tests: replacements on, literal off-by-default, code immunity, bold-inside-quotes. Suite green (173).
bd496ea to
b985d6b
Compare
Owner
Author
|
Blind cold review: approve with minor changes — all landed (amended into |
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.
Why
Tier 3 typographic polish from the roadmap: print-quality documents want real dashes, ellipses and curly quotes. Opt-in because GitHub does not smart-quote — default output stays byte-identical.
What changed
MarkdownComposer.builder().smartPunctuation(true)enablesflexmark-ext-typographicon the parser.TypographicSmarts(— – …) andTypographicQuotes(curly marks around mapped children, so"a **bold** word"keeps its bold) by riding the existing HTML-entity decoder; curly-quote/guillemet entities added.Verification
./mvnw clean verify javadoc:javadoc→ BUILD SUCCESS, 173 tests, 0 failures. New: replacements on; off-by-default literal; code immunity with the flag on; formatting-inside-quotes.