-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Any def
string in code block prevents block detection
#1006
Comments
I think we need to revert and review #974 as soon as possible. I don't recall how that could have slipped my checking. |
@Feder1co5oave and @KostyaTretyak: Agreed. I know of three ways to do that - and seem to only be able to do one of them myself. (Note: Believe it or not, I've never had to do a reversion.)
|
@joshbruce, please do the following via terminal from root the project: git checkout master
git revert a477d1d --no-edit
git push origin master It should go through without problems. And now I will pull request for revert |
@KostyaTretyak can you not open a PR to revert both commits? That would be neater. |
Well, I fixed my mistake, but now you need to fix the tests. |
Interestingly, CommonMark Spec have such a rule, but it seems that in our case it does not work for some reason (see tab HTML and > hello
> [1]: hello
* * *
> hello
[2]: hello
* hello
* [3]: hello
* hello
[4]: hello
> foo
> bar
[1]: foo
> bar
Output: <blockquote>
<p>hello
[1]: hello</p>
</blockquote>
<hr />
<blockquote>
<p>hello
[2]: hello</p>
</blockquote>
<ul>
<li>
<p>hello</p>
</li>
<li></li>
<li>
<p>hello
[4]: hello</p>
</li>
</ul>
<blockquote>
<p>foo
bar
[1]: foo
bar</p>
</blockquote> |
[foo]
> first row
> [foo]: /url
> third row Output: <p>[foo]</p>
<blockquote>
<p>first row
[foo]: /url
third row</p>
</blockquote> |
It's because link definitions cannot interrupt a paragraph. |
Whereas this is a problem:
|
Looks like this is a problem with the |
All right, I'm gonna just hold off until we answer a couple of things:
|
This issue is unexpected related to #1007. |
Yes it is correlated, because regexp are built via a cascade of replaces. By changing the
into two separate paragraphs, so that the |
However, in two of your three comments, you were wrong with the rules. Now we know that my test edits were correct, but I was incorrect when I deleted rule with blockquote from |
@rndstr: Thanks for the information. Gonna go ahead and close this per your comment. Think we've completed all the issues related to XSS vulnerabilities; so, we can get to the other parser issues. |
When there is a
def
at the beginning of any line within a code block, it is not recognized as such.Sample inputs
A
B
Expectation
The code block should be recognized as code block.
Result
The code block is not recognized and just rendered as paragraphs.
A
B
More information
This broke by commit 98ac7a4
which seemed to have originated in #974
and was supposed to fix #465
The text was updated successfully, but these errors were encountered: