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

Add :disable_parsers option. #379

Closed
wants to merge 1 commit into from
Closed

Add :disable_parsers option. #379

wants to merge 1 commit into from

Conversation

agriffis
Copy link

I'm using kramdown with jekyll, and I'd like to defer smart quotes and typographic dashes to rubypants via jekyll-pants. However kramdown makes this hard/impossible because there's no way to disable the built-in parsers.

(There is a workaround for smart quotes, which is to set smart_quotes: apos,apos,quot,quot, but this is clearly a hack and doesn't help for dashes and ellipses.)

This pull request adds :disable_parsers so that one could set disable_parsers: typographic_syms,smart_quotes to properly defer that processing. I made it generic rather than specific to those parsers since it seems like it could be generally useful.

This allows deferring, for example, smart quotes and typographic dashes
to a separate processor.
@gettalong gettalong self-assigned this Oct 16, 2016
@gettalong
Copy link
Owner

This won't be merged since the kramdown parser is not a only-take-what-you-like parser, it is designed to parse all documents created for it and therefore isn't customizable.

If you don't like how the kramdown parser works and/or if you need to add or remove a certain parser, you can create a new parser based on the kramdown parser. See the Markdown parser for an example.

@gettalong gettalong closed this Oct 16, 2016
@agriffis
Copy link
Author

@gettalong Thanks for the hint! I ended up with a simple subclass, see https://github.com/scampersand/jekyll-pants/blob/master/lib/jekyll/pants/down.rb and instructions for using it with jekyll at https://github.com/scampersand/jekyll-pants#compatibility-with-kramdown

@fliiiix
Copy link

fliiiix commented Apr 11, 2017

A way to disable Typographic Symbols would be nice since there are user like me, who prefer ascii over typographic symbols. And it's a bit annoying to replace them back to ascii.

@agriffis
Copy link
Author

@fliiiix Understanding that you're probably looking for a command-line option or something... Nonetheless, the small subclass I provided at the link above does exactly what you're looking for.

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

Successfully merging this pull request may close these issues.

None yet

3 participants