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 support for _italics_ using underscores to the Markdown parser #25564

Merged
merged 1 commit into from
Jan 16, 2018
Merged

Add support for _italics_ using underscores to the Markdown parser #25564

merged 1 commit into from
Jan 16, 2018

Conversation

yurivish
Copy link
Contributor

@yurivish yurivish commented Jan 15, 2018

Julia's base Markdown parser currently parses *italics* but not _italics_.

This pull request adds support for italics via underscores, as used on GitHub, Discourse, and Slack as specified in the original Markdown spec. Asterisks also continue to work.

Thanks to @c42f for help with this PR!

Copy link
Member

@c42f c42f left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is clearly a good idea, given that the original spec was pretty clear on the syntax.

For consistency, I think it would also be a good idea to add underscore_bold at the same time.

@@ -14,6 +14,12 @@ function asterisk_italic(stream::IO, md::MD)
return result === nothing ? nothing : Italic(parseinline(result, md))
end

@trigger '_' ->
function asterisk_italic_underscore(stream::IO, md::MD)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be better named underscore_italic I think ;-)

@ararslan ararslan added needs tests Unit tests are required for this change needs news A NEWS entry is required for this change labels Jan 15, 2018
Fix the naming scheme and allow the analogous bold syntax

more natural ordering of asterisk/underscore bold/italic entries in markdown flavors

Add NEWS entry

Add tests for _italics_ and __bold__
@yurivish
Copy link
Contributor Author

yurivish commented Jan 15, 2018

underscore_bold added, along with tests and a NEWS entry.

I've squashed it down to one commit; if the functionality is agreeable, this should be good to go.

@c42f c42f removed needs news A NEWS entry is required for this change needs tests Unit tests are required for this change labels Jan 16, 2018
@c42f
Copy link
Member

c42f commented Jan 16, 2018

Looks good to me. Just waaaaiting on Travis (other CI failures seem unrelated).

@c42f c42f merged commit 3c14013 into JuliaLang:master Jan 16, 2018
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.

4 participants