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

Blockquote tag appears after HTML not ending with newline #360

Closed
ivanspasov99 opened this issue Feb 1, 2023 · 3 comments
Closed

Blockquote tag appears after HTML not ending with newline #360

ivanspasov99 opened this issue Feb 1, 2023 · 3 comments

Comments

@ivanspasov99
Copy link

Using latest version of goldmark

If you have for example without newline at the end:

<pre>
text
<code>
var go int
<code>
<pre>

The library add empty <blockquote></blockquote> at the end of the generated HTML document.

@yuin
Copy link
Owner

yuin commented Feb 1, 2023

This can not be reproduced.

	markdown := New(
		goldmark.WithParserOptions(
			parser.WithAutoHeadingID(),
			parser.WithAttribute(),
		),
		goldmark.WithRendererOptions(
			html.WithUnsafe(),
			html.WithXHTML(),
		),
		goldmark.WithExtensions(
			extension.DefinitionList,
			extension.Footnote,
			extension.GFM,
			extension.Typographer,
			extension.Linkify,
			extension.Table,
			extension.TaskList,
		),
	)

	source := []byte(strings.TrimSpace(`<pre>
text
<code>
var go int
<code>
<pre>`))
	var b bytes.Buffer
	_ = markdown.Convert(source, &b)
	if b.String() != `<pre>
text
<code>
var go int
<code>
<pre>` {
		t.Error(b.String())
	}

@yuin yuin closed this as completed Feb 1, 2023
@jmooring
Copy link
Contributor

jmooring commented Feb 1, 2023

But it can be reproduced with valid HTML (note the proper syntax for closing tags):

<pre>
text
<code>
var go int
</code>
</pre>   <-- no newline

@ivanspasov99
Copy link
Author

But it can be reproduced with valid HTML (note the proper syntax for closing tags):

<pre>
text
<code>
var go int
</code>
</pre>   <-- no newline

Yes, my mistake, I will open new issue

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

3 participants