blackfriday icon indicating copy to clipboard operation
blackfriday copied to clipboard

Wrong smart quotes around some links

Open tf3 opened this issue 5 years ago • 2 comments

The second quotation mark in '[link](#)' is sometimes rendered incorrectly as an open quote, instead of as a close quote. This does not happen if the second quotation mark is followed by a period, but it does happen if the second quotation mark is followed by a colon or by a line break. So:

This is rendered '[correctly](#)'.

This is '[rendered](#)': incorrectly.

tf3 avatar Apr 21 '19 17:04 tf3

This is rendered '[correctly](#)'.

This is '[rendered](#)': incorrectly.

Hmm, @tf3, with my system both are correct (6…9). My setup looks like this:

extensions := bf.WithExtensions(
	bf.Autolink |
	bf.BackslashLineBreak |
	bf.DefinitionLists |
	bf.FencedCode |
	bf.Footnotes |
	bf.HeadingIDs |
	bf.NoIntraEmphasis |
	bf.SpaceHeadings |
	bf.Strikethrough |
	bf.Tables)
r := bf.NewHTMLRenderer(bf.HTMLRendererParameters{
	Flags: bf.FootnoteReturnLinks |
		bf.Smartypants |
		bf.SmartypantsFractions |
		bf.SmartypantsDashes |
		bf.SmartypantsLatexDashes,
})
result := bf.Run(aMarkdown, bf.WithRenderer(r), extensions)

What options do you use to produce your incorrect result?

mwat56 avatar May 23 '19 14:05 mwat56

I actually wasn't using Blackfriday directly. I was using Hugo, which uses Blackfriday to process Markdown files.

I just tried using Blackfriday by itself with the default options, and everything was correct. I'm not sure what options Hugo uses. Maybe the problem arises only with certain options, or maybe the problem is something else on Hugo's end. So I think I'll report the problem to them.

tf3 avatar May 26 '19 19:05 tf3