diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..99f04eb --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/frustra/bbcode + +go 1.24.9 diff --git a/html.go b/html.go index 6bd7fdd..e96fc20 100644 --- a/html.go +++ b/html.go @@ -15,6 +15,7 @@ import ( type HTMLTag struct { Name string Value string + Raw bool Attrs map[string]string Children []*HTMLTag } @@ -35,9 +36,9 @@ func (t *HTMLTag) String() string { // The html representation of the tag with or without sorted arguments. func (t *HTMLTag) Compile(sorted bool) string { - var value string - if len(t.Value) > 0 { - value = html.EscapeString(t.Value) + value := t.Value + if !t.Raw && len(value) > 0 { + value = html.EscapeString(value) } var attrString string