goldmark-pdf
goldmark-pdf copied to clipboard
Rendering quotes
Thanks for a great package. Is there a way to customise the renderer to parse quotes correctly.
Consider source:
source := `"Just a test"`
markdown := goldmark.New(
goldmark.WithRenderer(
pdf.New(
pdf.WithHeadingFont(pdf.GetTextFont("Times", pdf.FontTimes)),
pdf.WithBodyFont(pdf.GetTextFont("Times", pdf.FontTimes)),
)),
)
var buf bytes.Buffer
if err := markdown.Convert([]byte(source), &buf); err != nil {
return err
}
buf.Bytes()
Will produce:
"Just a test"
The desired output is "Just a test"
I presume this has to do with passing correct options to WithNodeRenderers()
, but struggling to see what those are from the source code.
Thanks for the help!
I suspect this has something to do with encoding HTML entities. Maybe because of some copied code from the HTML renderer. I'll take a look.
A similar "issue" was present in the default gold mark html renderer and I managed to solve it by passing html.WithXHTML()
to goldmark.WithRendererOptions
.