Allow "*/" inside commented out shortcodes

Fixes #4608
This commit is contained in:
Bjørn Erik Pedersen 2018-04-11 22:41:48 +02:00
parent 96689a5c31
commit 14c35c8a56
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 4 additions and 5 deletions

View file

@ -312,7 +312,7 @@ func lexShortcodeLeftDelim(l *pagelexer) stateFunc {
}
func lexShortcodeComment(l *pagelexer) stateFunc {
posRightComment := strings.Index(l.input[l.pos:], rightComment)
posRightComment := strings.Index(l.input[l.pos:], rightComment+l.currentRightShortcodeDelim())
if posRightComment <= 1 {
return l.errorf("comment must be closed")
}
@ -324,9 +324,6 @@ func lexShortcodeComment(l *pagelexer) stateFunc {
l.emit(tText)
l.pos += pos(len(rightComment))
l.ignore()
if !strings.HasPrefix(l.input[l.pos:], l.currentRightShortcodeDelim()) {
return l.errorf("comment ends before the right shortcode delimiter")
}
l.pos += pos(len(l.currentRightShortcodeDelim()))
l.emit(tText)
return lexTextOutsideShortcodes