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

Handle Guesser::Ambiguous during markdown processing #1349

Merged
merged 1 commit into from Oct 13, 2019

Conversation

johnfairh
Copy link
Contributor

Second part of #1343, handle the 'ambiguous lexer' case and pick an arbitrary one when Rouge is (a) running its markdown lexer and (b) invoked by redcarpet in the same kind of context.

I wasn't sure whether you'd prefer the repeated code factored into a Lexer.find_fancy_safe or something.

@jneen
Copy link
Member

jneen commented Oct 13, 2019

👍 from me - the author of the markdown file has full control over the choice of language, so choosing the wrong one seems less bad than throwing an exception here.

@pyrmont pyrmont self-assigned this Oct 13, 2019
@pyrmont pyrmont merged commit 8ffc50b into rouge-ruby:master Oct 13, 2019
@pyrmont
Copy link
Contributor

pyrmont commented Oct 13, 2019

Thanks for this one, too @johnfairh. It may be worth factoring this into the kind of method you suggested but for the moment, this seems as good an approach as any. Cheers!

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