You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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?
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.
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.
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...
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
Activity
guypursey commentedon Aug 6, 2014
+1 Ditto.
guypursey commentedon Aug 6, 2014
Line 2 in
./test/tests/def_blocks.textis being treated like a reflink because of line 20
One can see this is expected behaviour by comparing
./test/tests/links_reference_style.textwith./test/tests/links_reference_style.html.If
def_blocks.textis 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 theInlineLexer.prototype.outputfunction 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 commentedon Aug 6, 2014
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 commentedon Jan 4, 2015
Has any decision been made on this?
I see two issues here:
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.
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.
Fixed markedjs/marked#465
KostyaTretyak commentedon Dec 18, 2017
It looks like you just need to delete these lines and fix the tests like this.
joshbruce commentedon Dec 18, 2017
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 commentedon Dec 18, 2017
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 commentedon Dec 18, 2017
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 commentedon Dec 18, 2017
Done #974
Fixed markedjs/marked#465
Feder1co5oave commentedon Dec 27, 2017
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.
Fixed markedjs#465