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

[Typographer] Quotes between emphasis characters and link are rendered as normal quotes #133

Closed bhavin192 closed 4 years ago

bhavin192 commented 4 years ago
  1. What version of goldmark are you using? : Latest from master i.e. v1.1.31 or 3d78558cf265c6fbc4e20b74fec0809ea2b67d5d
  2. What version of Go are you using? : go version go1.14.2 linux/amd64
  3. What operating system and processor architecture are you using? : Fedora 32 on amd64
  4. What did you do? :
    
    package main

import ( "bytes" "fmt"

"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"

)

func main() { md := goldmark.New(goldmark.WithExtensions(extension.Typographer))

source := `*"[Some link here](https://geeksocket.in)" and more text here.*`
var buf bytes.Buffer
if err := md.Convert([]byte(source), &buf); err != nil {
    panic(err)
}
fmt.Println(buf.String())

source2 := `**"[Another link](https://geeksocket.in)"**`
var buf2 bytes.Buffer
if err := md.Convert([]byte(source2), &buf2); err != nil {
    panic(err)
}
fmt.Println(buf2.String())

}

5. What did you expect to see? :
The quotes in both cases to be `“` and `”`.
6. What did you see instead? :
The quotes near `*` are `"` instead of `“` and `”`.
```html
<p><em>&quot;<a href="https://geeksocket.in">Some link here</a>&rdquo; and more text here.</em></p>

<p><strong>&quot;<a href="https://geeksocket.in">Another link</a>&quot;</strong></p>
  1. Did you confirm your output is different from CommonMark online demo or other official renderer correspond with an extension?: Yes, enabled Smart punctuation option.
bhavin192 commented 4 years ago

Duplicate of https://github.com/yuin/goldmark/issues/128 Closing, reason https://github.com/yuin/goldmark/issues/39#issuecomment-561044672