-
Notifications
You must be signed in to change notification settings - Fork 1
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
Muse: do not allow newlines after opening and before closing "*" #5
Comments
This is actually impossible to fix due to the limitations of the TextMate grammar system. It processes documents one line at a time, which means something like this:
is impossible to differentiate from this:
I could prevent a lone /^\*$/ |
I have it fixed in My emphasis parsing is here: |
Yes, that's because Atom recently changed their highlighting-engine to support newlines. However, other TextMate-grammar implementations don't support this (notably GitHub's). You can see for yourself: |
First example works correctly, the second I just fixed: Now both examples work correctly on https://github-lightshow.herokuapp.com/ |
What about this?
Lightshow is tokenising it as <pre class="code"><span class="pl-mi">*foo bar</span>
<span class="pl-mi">* baz</span>
</pre> ... but Pandoc gives me: <p>*foo bar</p>
<h1 id="baz">baz</h1> |
This markup is invalid because
Generally speaking, any block markup should break paragraphs, and it is better to parse it as
because otherwise we can't determine if the second line is a block or not without parsing the third line. Pandoc implementation does backtracking which may be quite expensive in extreme cases, like lots of nested unclosed tags. In |
Alternatively, it can be treated as a part of inline markup, even if there is no closing |
How should this be treated?
The
This means that the code above should be rendered like this: <p>Foo *<em>boldbar baz qux</em>* qul</p> But, wouldn't it be more natural to render it like this...? <p>Foo <strong><em>boldbar baz qux</em></strong> qul</p> |
I think it should be <p>Foo <strong>bold**bar baz qux</strong> qul</p> Text::Amuse produced this: <p>
Foo <strong>bold**bar baz qux</strong> qul
</p> |
Pandoc is fixed, now it produces <p>Foo <strong>bold**bar baz qux</strong> qul</p> |
Is there a painless way to run an up-to-date All I need is the raw HTML output, I don't give a crap about EPUB or LaTeX, so there's a million CPAN dependencies I don't need which are probably adding to the installation grief. |
You can use this script prepared for GitHub markup repository: |
Thanks anyway though. 😅 |
Okay, I think I've fixed the emphasis matching. Could I get you to update your branch locally and tell me if there's anything I've missed? Bear in mind there's nothing we can do about this:
Which, given TextMate's limitations, is for all intents and purposes the same as:
|
This should not be highlighted as emphasized:
This is unclosed emphasis:
The text was updated successfully, but these errors were encountered: