summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaa <kaa@disroot.org>2025-07-27 18:00:07 -0700
committerkaa <kaa@disroot.org>2025-07-27 18:00:07 -0700
commit6a4f99d6658512e1b5c3e7e5d5ad13aec26e4020 (patch)
treee92669ebf211751ca427c2e4a6b008ecde9bcb3a
parentdf0678382d5f1e4638ca0d29cf7984d756bc3249 (diff)
Tag to string.
-rw-r--r--lib/parse/parse.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/parse/parse.go b/lib/parse/parse.go
index c3e58aa..a86e166 100644
--- a/lib/parse/parse.go
+++ b/lib/parse/parse.go
@@ -11,6 +11,15 @@ type Tag struct {
attributes map[string]string
}
+func (t *Tag) String() string {
+ s := "<" + t.name
+ for k, v := range t.attributes {
+ s += " " + k + `="` + v + `"`
+ }
+ s += ">"
+ return s
+}
+
func ReadUntil(r io.Reader, sentinels []byte) (string, byte, error) {
b := make([]byte, 1)
var buf []byte