summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcodeparser.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-11 22:41:48 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-04-11 22:41:48 +0200
commit14c35c8a56c4dc9a1ee0053e9ff976be7715ba99 (patch)
tree4900617cb367920ef07cbb1e40c423812fe36459 /hugolib/shortcodeparser.go
parent96689a5c319f720368491226f034d0ff9585217c (diff)
Allow "*/" inside commented out shortcodes
Fixes #4608
Diffstat (limited to 'hugolib/shortcodeparser.go')
-rw-r--r--hugolib/shortcodeparser.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/hugolib/shortcodeparser.go b/hugolib/shortcodeparser.go
index 18b1454cd..c57ff9b3c 100644
--- a/hugolib/shortcodeparser.go
+++ b/hugolib/shortcodeparser.go
@@ -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