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

Rogue tildes rendering of a fenced code block within a list #323

Closed
soypat opened this issue Sep 4, 2022 · 1 comment
Closed

Rogue tildes rendering of a fenced code block within a list #323

soypat opened this issue Sep 4, 2022 · 1 comment

Comments

@soypat
Copy link
Contributor

soypat commented Sep 4, 2022

  1. What version of goldmark are you using? : 1.4.14
  2. What version of Go are you using? : go 1.19
  3. What operating system and processor architecture are you using? : linux amd64
  4. What did you do? : Tried to render the following markdown.
1. 
	```
	```
  1. What did you expect to see? :
<ol>
<li>
<pre><code></code></pre>
</li>
</ol>
  1. What did you see instead? : rogue tildes
<ol>
<li>
<pre><code></code></pre>
``</li>
</ol>
  1. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?:
    Yes.
@CarsonSlovoka
Copy link

go 1.19
require github.com/yuin/goldmark v1.4.14
package _test

import (
	"github.com/yuin/goldmark"
	"os"
	"strings"
)

func Example_convert() {
	m := goldmark.New()
	source := `
1.
	aaa
	aaa
`
	source = strings.ReplaceAll(source, "aaa", "```")

	_ = m.Convert([]byte(source), os.Stdout)
	// Output:
	// <ol>
	// <li>
	// <pre><code></code></pre>
	// </li>
	// </ol>
}

output:

=== RUN   Example_convert
--- FAIL: Example_convert (0.00s)
got:
<ol>
<li>
<pre><code></code></pre>
``</li>
</ol>
want:
<ol>
<li>
<pre><code></code></pre>
</li>
</ol>

FAIL

@yuin yuin closed this as completed in a3630e3 Sep 19, 2022
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

2 participants