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

Closing tag on a new line doesn't work #406

Closed
Gusted opened this issue Jul 22, 2023 · 0 comments
Closed

Closing tag on a new line doesn't work #406

Gusted opened this issue Jul 22, 2023 · 0 comments

Comments

@Gusted
Copy link

Gusted commented Jul 22, 2023

  1. What version of goldmark are you using? : 1.5.4
  2. What version of Go are you using? : go1.20.6
  3. What operating system and processor architecture are you using? : linux/amd64
  4. What did you do? : Tried to render an <img> with the closing tag on a new line.
import (
	"bytes"
	"fmt"

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

func main() {
	md := goldmark.New(
		goldmark.WithRendererOptions(
			html.WithUnsafe(),
		),
	)
	var buf bytes.Buffer
	if err := md.Convert([]byte("<img src=./.assets/logo.svg\n/>"), &buf); err != nil {
		panic(err)
	}
	fmt.Println(buf.String())
}
  1. What did you expect to see? :
<p><img src=./.assets/logo.svg
/></p>
  1. What did you see instead? :
<p>&lt;img src=./.assets/logo.svg
/&gt;</p>
  1. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?: https://spec.commonmark.org/dingus/?text=%3Cimg%20src%3D.%2F.assets%2Flogo.svg%0A%2F%3E
@yuin yuin closed this as completed in 254b9f8 Jul 23, 2023
persuader72 pushed a commit to persuader72/goldmark that referenced this issue Apr 19, 2024
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