Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/frustra/bbcode

go 1.24.9
7 changes: 4 additions & 3 deletions html.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
type HTMLTag struct {
Name string
Value string
Raw bool
Attrs map[string]string
Children []*HTMLTag
}
Expand All @@ -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
Expand Down