yuin / goldmark

:trophy: A markdown parser written in Go. Easy to extend, standard(CommonMark) compliant, well structured.
MIT License
3.68k stars 255 forks source link

Render discrepancy when combining backtick (for code), underscore and asterisk (em) #141

Closed sciurius closed 4 years ago

sciurius commented 4 years ago
  1. What version of goldmark are you using? : assuming latest

  2. What version of Go are you using? : go version go1.13.11 linux/amd64

  3. What operating system and processor architecture are you using? : Fedora 31 AMD64

  4. What did you do? : See attached program

package main

import (
    "bytes"
    "fmt"
    "github.com/yuin/goldmark"
)

func main () {
    var buf bytes.Buffer
    goldmark.Convert([]byte("`{%`_name_`%}`"), &buf)
    goldmark.Convert([]byte("`{%`*name*`%}`"), &buf)
    fmt.Println(buf.String())
}

emrender.zip

  1. What did you expect to see? :

According to the specs, `{%`_name_`%}` and `{%`*name*`%}` should both render to <p><code>{%</code><em>name</em><code>%}</code></p>

  1. What did you see instead? :

`{%`_name_`%}` is rendered to <p><code>{%</code>_name_<code>%}</code></p>

  1. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?: yes