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

Fix gfm highlighting with _ and __ (see #96 and #61) #148

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bitwiser73
Copy link

This is a fix for gfm handling of _ (italic) and __ (bold), see #96 and #61

Here's my test file before and after:

before_patch
after_patch

It would be simpler to remove completly the _ from (**|__)(?=\S) and support only * but it would be against standard...

@jonschlinkert
Copy link
Owner

@bitwiser73 sorry it's been a while.

I'd love to merge this, but I haven't had time to test it locally (and it seems like every time I've merged in regex changes there have been regressions). I'd love to find a way to do tests with this package, it would make these decisions much easier. For now, I'd settle for at least another user or two confirming that these changes don't break anything.

@dcabecinhas
Copy link

The patch works for me with no adverse side effects that I have noticed.

@jonschlinkert
Copy link
Owner

One thing I don't see in the examples is a mixture of bold and italics or mixtures of the variants of both kinds of bold and italics. The patterns in the examples are fairly "safe".

@jonschlinkert
Copy link
Owner

@bitwiser73 it would help if you could paste all of that text into a gist or a gfm block in a comment so I don't have to retype it all. thanks!

@pradyunsg
Copy link

@jonschlinkert Could this get merged?

@braver
Copy link

braver commented Aug 30, 2017

@jonschlinkert

I'd love to find a way to do tests with this package, it would make these decisions much easier

There is a standardised syntax test in Sublime Text 3, like they're using for the default packages: https://github.com/sublimehq/Packages/blob/master/Markdown/syntax_test_markdown.md. You just write a markdown file with some annotations for which scopes you expect and Sublime will run it. I was planning to add tests (derived from the default package's Markdown syntax) to my fork of this repo anyway and if you're interested I could do a PR so you can borrow it?

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.

5 participants