goldmark
goldmark copied to clipboard
Rogue tildes rendering of a fenced code block within a list
- What version of goldmark are you using? : 1.4.14
- What version of Go are you using? : go 1.19
- What operating system and processor architecture are you using? : linux amd64
- What did you do? : Tried to render the following markdown.
1.
```
```
- What did you expect to see? :
<ol>
<li>
<pre><code></code></pre>
</li>
</ol>
- What did you see instead? : rogue tildes
<ol>
<li>
<pre><code></code></pre>
``</li>
</ol>
- Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?: Yes.
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