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

Underscores in string interfering with bold text elsewhere in the string #28

Open
rboschjr opened this issue Oct 29, 2018 · 2 comments
Open

Comments

@rboschjr
Copy link

I'm using Marker to lay out a definition-list-type presentation, with entries like so:

**answer**: Clue text

And it's working fine for the most part, but the following case fails to render correctly:

**myrtle**: ___ Beach

(There's three underscores there for the blank, with a single space before and after.)

Instead of producing 'myrtle' in bold, the line renders as written, with the asterisks present in the output instead.

  • Markdown: **myrtle**: ___ Beach
  • Expected result: myrtle: ___ Beach
  • Observed result: **myrtle**: ___ Beach

I tried entering the string in a couple of online Markdown editors (to confirm that the string is valid), and they both rendered it correctly with 'myrtle' in bold and the underscores intact (as it does above).

I did a little experimenting and found that a single underscore works fine, but two or more causes the issue, and the blank causes trouble no matter where it appears in the string -- before or after the bold word, adjacent or not.

Let me know if you need any additional details -- thanks!

@rboschjr
Copy link
Author

rboschjr commented Nov 7, 2018

Not too surprising, I guess, but it looks like the issue is that the parser is treating the first two underscores of the blank as the beginning of a tag and is throwing an unclosedTags exception since it doesn't find another __ to close it. If I try it with four underscores, it treats the whole thing as an empty emphasis block and produces something like so, with the four underscores replaced with a single space:

myrtle: Beach

@rboschjr
Copy link
Author

rboschjr commented Nov 7, 2018

Using backslashes to escape the underscores works for me; not sure if that's a fix or a workaround (hard to say for sure since the Markdown grammar is somewhat ambiguous), but that's at least got me unstuck. Feel free to close this one out if the current behavior is by design or if you don't think it's worth changing.

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

No branches or pull requests

1 participant