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

Tests failing in a fresh checkout #465

Closed
pdubroy opened this issue Aug 4, 2014 · 10 comments · Fixed by webcomponents/custom-elements-everywhere#201 or #1023
Closed

Tests failing in a fresh checkout #465

pdubroy opened this issue Aug 4, 2014 · 10 comments · Fixed by webcomponents/custom-elements-everywhere#201 or #1023

Comments

@pdubroy
Copy link

pdubroy commented Aug 4, 2014

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.

@guypursey
Copy link

+1 Ditto.

@guypursey
Copy link

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.

@guypursey
Copy link

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?

@andre-artus
Copy link

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.

KostyaTretyak added a commit to ts-stack/markdown that referenced this issue Dec 18, 2017
@KostyaTretyak
Copy link
Contributor

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

@joshbruce
Copy link
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.

@KostyaTretyak
Copy link
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...

@joshbruce
Copy link
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

@KostyaTretyak
Copy link
Contributor

Done #974

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment