Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit 9c20879

Browse files
gigameshMatt Masurka
andauthored
Escapes parens in URLs (#513)
Co-authored-by: Matt Masurka <masurka@google.com>
1 parent 543bbf7 commit 9c20879

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

claat/render/md.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ func (mw *mdWriter) url(n *types.URLNode) {
207207
}
208208
mw.write(n.Content.Nodes...)
209209
if n.URL != "" {
210+
// escape parentheses
211+
strings.Replace(n.URL, "(", "%28", -1)
212+
strings.Replace(n.URL, ")", "%29", -1)
210213
mw.writeString("](")
211214
mw.writeString(n.URL)
212215
mw.writeString(")")

0 commit comments

Comments
 (0)