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

code block containing line break with new line starting with html fails #501

Closed
kapouer opened this issue Oct 16, 2014 · 6 comments · Fixed by #1135
Closed

code block containing line break with new line starting with html fails #501

kapouer opened this issue Oct 16, 2014 · 6 comments · Fixed by #1135
Labels
category: mixed content L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue

Comments

@kapouer
Copy link
Contributor

kapouer commented Oct 16, 2014

This fails

Additionally, arbitrary scripts can be executed by running `npm run-script
<pkg> <stage>`. Test.

giving

<p>Additionally, arbitrary scripts can be executed by running `npm run-script</p>
<p><pkg> <stage>`. Test.</p>

but this doesn't:

Additionally, arbitrary scripts can be executed by running `npm
run-script <pkg> <stage>`. Test.

giving

<p>Additionally, arbitrary scripts can be executed by running <code>npm
run-script &lt;pkg&gt; &lt;stage&gt;</code>. Test.</p>
@joshbruce
Copy link
Member

#983

@Feder1co5oave
Copy link
Contributor

Interesting.
This is still a bug in 0.3.12

@Feder1co5oave
Copy link
Contributor

Problem here is in the block lexing phase:

> marked.lexer('Additionally, arbitrary scripts can be executed by running `npm run-script\n<pkg> <stage>`. Test.')
[ { type: 'paragraph',
    text: 'Additionally, arbitrary scripts can be executed by running `npm run-script' },
  { type: 'paragraph', text: '<pkg> <stage>`. Test.' },
  links: {} ]

Since the first item on the new line looks like an html tag, the regex stops matching the current paragraph. Then it opens a new one.

@Feder1co5oave
Copy link
Contributor

As a reference, commonmark.js 0.28.1 renders them both as the same:

Additionally, arbitrary scripts can be executed by running `npm run-script
<pkg> <stage>`. Test.

Additionally, arbitrary scripts can be executed by running `npm
run-script <pkg> <stage>`. Test.
<p>Additionally, arbitrary scripts can be executed by running <code>npm run-script &lt;pkg&gt; &lt;stage&gt;</code>. Test.</p>
<p>Additionally, arbitrary scripts can be executed by running <code>npm run-script &lt;pkg&gt; &lt;stage&gt;</code>. Test.</p>

@joshbruce
Copy link
Member

Reopening.

@joshbruce joshbruce reopened this Jan 20, 2018
@Feder1co5oave
Copy link
Contributor

Categorize for #985

@Feder1co5oave Feder1co5oave added this to the 0.4.0 - No known defects milestone Feb 23, 2018
@Feder1co5oave Feder1co5oave added category: mixed content L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue labels Feb 23, 2018
@joshbruce joshbruce removed this from the 0.4.0 - No known defects milestone Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: mixed content L2 - annoying Similar to L1 - broken but there is a known workaround available for the issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants