镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Closed

Description

@kapouer

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>

Activity

  1. joshbruce commented on Dec 25, 2017

    @joshbruce
    Member
  2. Feder1co5oave commented on Jan 10, 2018

    @Feder1co5oave
    Contributor

    Interesting.
    This is still a bug in 0.3.12

  3. Feder1co5oave commented on Jan 15, 2018

    @Feder1co5oave
    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.

  4. Feder1co5oave commented on Jan 19, 2018

    @Feder1co5oave
    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>
  5. joshbruce commented on Jan 20, 2018

    @joshbruce
    Member

    Reopening.

  6. Feder1co5oave commented on Jan 25, 2018

    @Feder1co5oave
    Contributor

    Categorize for #985

  7. added this to the milestone on Feb 23, 2018
  8. removed this from the milestone on Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    L2 - annoyingSimilar to L1 - broken but there is a known workaround available for the issuecategory: mixed content

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions