Skip to content

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

Open
bitwiser73 wants to merge 1 commit into
jonschlinkert:masterfrom
bitwiser73:master
Open

Fix gfm highlighting with _ and __ (see #96 and #61)#148
bitwiser73 wants to merge 1 commit into
jonschlinkert:masterfrom
bitwiser73:master

Conversation

@bitwiser73
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown

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

@jonschlinkert
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@jonschlinkert Could this get merged?

@braver
Copy link
Copy Markdown

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