From 188088e2fb84c4d452214ebf7f283b4a8bcb9901 Mon Sep 17 00:00:00 2001 From: mappu Date: Sun, 9 Jul 2017 13:52:26 +1200 Subject: [PATCH] fix offsets in [html] tags --- bbcode.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bbcode.go b/bbcode.go index 31c20e7..dad1665 100644 --- a/bbcode.go +++ b/bbcode.go @@ -166,6 +166,7 @@ func (this *BBCodeRenderer) displayfmt(s string) string { if spos == -1 { break } + spos += hpos ret += this.bbformat(s[hpos : spos-hpos]) spos += 6 @@ -174,6 +175,7 @@ func (this *BBCodeRenderer) displayfmt(s string) string { if epos == -1 { break // no matching [/html] tag found } + epos += spos jsonInnerContent, _ := json.Marshal(s[spos : epos-spos])