diff options
author | Unknwon <u@gogs.io> | 2016-02-19 17:39:50 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-02-19 17:39:50 -0500 |
commit | 341da3cea7b194e74057612efc6fb97cb57f1446 (patch) | |
tree | a4d74dc2ad864de6a0c6a00797d2ebaec5ea9354 /modules | |
parent | 716209563532587928099b33f0481d44fbf78c46 (diff) | |
download | gitea-341da3cea7b194e74057612efc6fb97cb57f1446.tar.gz gitea-341da3cea7b194e74057612efc6fb97cb57f1446.zip |
Fix inappropriate markdown post process end tag check
When <code> is nested inside <pre>, the next end tag token would not able to be the same
as outer-most start tag. So we only check outer-most start and end tag token to be the same.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/base/markdown.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go index dac51ebc27..10158edd32 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -303,10 +303,10 @@ OUTER_LOOP: } // If this is the close tag to the outer-most, we are done - if token.Type == html.EndTagToken && strings.EqualFold(tagName, token.Data) { + if token.Type == html.EndTagToken { stackNum-- - if stackNum == 0 { + if stackNum <= 0 && strings.EqualFold(tagName, token.Data) { break } } |