From 341da3cea7b194e74057612efc6fb97cb57f1446 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 19 Feb 2016 17:39:50 -0500 Subject: Fix inappropriate markdown post process end tag check When is nested inside
, 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.
---
 modules/base/markdown.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'modules')

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
 						}
 					}
-- 
cgit v1.2.3