Adding a text node to the AST #215
Answered
by
yuin
matthewmueller
asked this question in
Q&A
-
Hey there, I'd like to add a new section to the AST tree before rendering it. Something like the following: h1 := ast.NewHeading(1)
txt := ast.NewText()
txt.Text(value) // This is what I can't figure out.
h1.AppendChild(txt)
doc.AppendChild(h1) Any ideas how I can add text? Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
yuin
Apr 21, 2021
Replies: 1 comment
-
Use |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
matthewmueller
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
ast.String
instead ofast.Text