3 ms·
> dedicated O/0, and l/1 keys now And the 1 and 8 aren't next to each other anymore, either. (See typewriters from the "18"00s.) > those smart quotes Fixing
by thangalin 2y ago
> dedicated O/0, and l/1 keys now
And the 1 and 8 aren't next to each other anymore, either. (See typewriters from the "18"00s.)
> those smart quotes
Fixing straight quotes is a hard problem[0]. My FOSS text editor, KeenWrite[1], includes my library, KeenQuotes[2], for replacing them at build time. It's not perfect, but can typeset my ~400 page novel without any errors.
> Did you know there is a dedicated ellipsis character?
Yes! Here's where it gets parsed:
https://gitlab.com/DaveJarvis/KeenQuotes/-/blob/main/src/main/java/com/whitemagicsoftware/keenquotes/lex/Lexer.java#L126 https://gitlab.com/DaveJarvis/KeenQuotes/-/blob/main/src/mai...
Then emitted:
https://gitlab.com/DaveJarvis/KeenQuotes/-/blob/main/src/main/java/com/whitemagicsoftware/keenquotes/parser/QuoteEmitter.java#L390 https://gitlab.com/DaveJarvis/KeenQuotes/-/blob/main/src/mai...
Then transformed into an HTML entity:
https://gitlab.com/DaveJarvis/KeenQuotes/-/blob/main/src/main/java/com/whitemagicsoftware/keenquotes/parser/Token.java#L38 https://gitlab.com/DaveJarvis/KeenQuotes/-/blob/main/src/mai...
When typesetting Markdown, KeenWrite first converts the document to XHTML (i.e., XML), then invokes ConTeXt to convert XML into TeX macros. One of those macros handles the ellipses by converting it to \dots{}:
https://gitlab.com/DaveJarvis/keenwrite-themes/-/blob/main/xhtml/xml-entities.tex?ref_type=heads#L28 https://gitlab.com/DaveJarvis/keenwrite-themes/-/blob/main/x...
This renders as the Unicode character in the final document: …
> set with more care for details
Some of us old folks care about these details. ;-)
[0]: https://stackoverflow.com/a/73466438/59087 https://stackoverflow.com/a/73466438/59087
[1]: https://keenwrite.com/ https://keenwrite.com/
[2]: https://whitemagicsoftware.com/keenquotes https://whitemagicsoftware.com/keenquotes