Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression 1.4.7 -> 1.4.8 (html.WithUnsafe) #285

Closed
jmooring opened this issue Mar 10, 2022 · 1 comment
Closed

Regression 1.4.7 -> 1.4.8 (html.WithUnsafe) #285

jmooring opened this issue Mar 10, 2022 · 1 comment

Comments

@jmooring
Copy link
Contributor

jmooring commented Mar 10, 2022

markdown

a <!-- b --> c

expected

<p>a <!-- b --> c</p

actual

<p>a &lt;!-- b --&gt; c</p>
test.go
package main

import (
	"bytes"
	"fmt"

	"github.com/yuin/goldmark"
	"github.com/yuin/goldmark/renderer/html"
)

func main() {
	md := goldmark.New(
		goldmark.WithRendererOptions(
			html.WithUnsafe(),
		),
	)

	input := `a <!-- b --> c`

	var buf bytes.Buffer
	if err := md.Convert([]byte(input), &buf); err != nil {
		panic(err)
	}

	fmt.Println(buf.String())

}

CommonMark dingus

@jmooring
Copy link
Contributor Author

@yuin Thank you for the quick fix. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant