Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typography plugin #94

Open
jace opened this issue Aug 25, 2016 · 1 comment
Open

Typography plugin #94

jace opened this issue Aug 25, 2016 · 1 comment

Comments

@jace
Copy link
Member

jace commented Aug 25, 2016

The Zine typography plugin (@jace's branch) offers better accuracy than Smartypants. Since it parses HTML and not markdown, it can be applied on both markdown and richtext fields.

Consider this text: I'm positive I was 5'10" by the late '90s.
Smartypants rendering: I’m positive I was 5’10” by the late ‘90s.
Correct rendering: I’m positive I was 5′10″ by the late ’90s.

However, since the Zine plugin is written for Zine's since-abandoned HTML parser, it needs to be rewritten for html5lib. The Zine parser notably differs from html5lib in how it handles text outside a tag.

Caveat: This plugin, like Smartypants, is a batch parser and breaks the realtime WYSIWYG expectations of a richtext widget. Since richtext fields don't store original and rendered text separately, it is also destructive: parser errors cannot be recovered from.

@jace
Copy link
Member Author

jace commented Apr 30, 2020

Bumping this up. Our Markdown parser now has its first HTML tree processor. This is now a matter of porting from Zine's HTML parser to ElementTree, and they seem to have similar APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant