Skip to content

Tests failing in a fresh checkout #465

Closed
webcomponents/custom-elements-everywhere
#201

Description

@pdubroy

I just cloned master and ran node test, and got the following failure:

#10. def_blocks.text failed at offset 20. Near: "<blockquote><p>hello</p><p><ahref="foo">1</a>:hell".


Got:
<blockquote><p>hello</p><p><ahref="foo">1</a>:hell


Expected:
<blockquote><p>hello[1]:hello</p></blockquote><hr>

Not sure if this is a known issue or not, but thought I'd open a bug in case you weren't aware of it.

Activity

  1. guypursey commented on Aug 6, 2014

    @guypursey

    +1 Ditto.

  2. guypursey commented on Aug 6, 2014

    @guypursey

    Line 2 in ./test/tests/def_blocks.text

    > [1]: hello
    

    is being treated like a reflink because of line 20

    [1]: foo
    

    One can see this is expected behaviour by comparing ./test/tests/links_reference_style.text with ./test/tests/links_reference_style.html.

    If def_blocks.text is to pass, the reflink inline lexer (lines 626-641 in ./lib/marked.js) needs to somehow skip reflinking when we are in a blockquote. But having only just looked into the code I can't quite see how to do that. It might be simple but I can't see how to perform the check within the function; it looks like a string is simply passed to the InlineLexer.prototype.output function to be formatted without context.

    Apologies if this is all stating the obvious. Happy to keep looking but thought I would document this here in case someone more familiar with the code can get to a fix quicker.

  3. guypursey commented on Aug 6, 2014

    @guypursey

    It might be that want to keep reflinking within blockquotes, of course, in which case it's simply a matter of rewriting ./test/tests/def_blocks.html. One to discuss?

  4. andre-artus commented on Jan 4, 2015

    @andre-artus

    Has any decision been made on this?

    I see two issues here:

    1. Ref links should require two sets of square brackets.
      As @guypursey pointed out the first instance of [1] is treated as a ref link to the second instance.
      This should not happen on a single pair of brackets.
    2. The test is broken (def_blocks.text, and def_blocks.html).
      Assuming that this test pair are intended to contain ref links then both the input (def_blocks.text)
      and expected result (def_blocks.html) ought to be modified accordingly.
  5. added a commit that references this issue on Dec 18, 2017
  6. KostyaTretyak commented on Dec 18, 2017

    @KostyaTretyak
    Contributor

    It looks like you just need to delete these lines and fix the tests like this.

  7. joshbruce commented on Dec 18, 2017

    @joshbruce
    Member

    Closing as stale. "Fresh" was three years ago. Things have most likely changed a great deal.

    See also #956

    And #958

    Please do contribute solutions back to the main line.

  8. KostyaTretyak commented on Dec 18, 2017

    @KostyaTretyak
    Contributor

    Things have most likely changed a great deal.

    But the fact that the current version marked (from master) does not pass this test in the same way. For three years, this simple test has been failing all the time...

  9. joshbruce commented on Dec 18, 2017

    @joshbruce
    Member

    Agreed. There are two failing tests in the PR referenced. If you know how to fix them (as it seems you do??), please do so and contribute back. I don't know enough about Marked to do it myself; otherwise, I would.

    One person can't maintain this library. As evidenced by #956

  10. KostyaTretyak commented on Dec 18, 2017

    @KostyaTretyak
    Contributor

    Done #974

  11. added a commit that references this issue on Dec 24, 2017
  12. Feder1co5oave commented on Dec 27, 2017

    @Feder1co5oave
    Contributor

    From the commonmark spec, I see that link definitions are allowed inside blockquotes too:
    http://spec.commonmark.org/0.28/#example-181

    So wrt commonmark, the def_blocks test looks wrong to me.

  13. added a commit that references this issue on Nov 8, 2021
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions