diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-06-13 19:10:53 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-06-15 09:12:07 +0200 |
commit | 34f40044d7144dddcd613d60df8e24985158dd8c (patch) | |
tree | abf9f60821adbcbea8a519112c3ea60155c6bdaa /helpers | |
parent | 6ba074562c3ca16af352755dc90e78139782f569 (diff) |
Fix shortcode in markdown headers
This issue was introduced as a fix to shortcode not working in RST.
One could argue that Blackfriday and friends should handle `#` in titles, but that will be a discussion
for another day.
The new placeholder pattern should be RST safe and work with titles.
And now with a test so this doesn't break again.
Fixes #2192
Fixes #2209
Closes #2210
Diffstat (limited to 'helpers')
-rw-r--r-- | helpers/content_renderer.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/helpers/content_renderer.go b/helpers/content_renderer.go index 18df9ebef..1613d7613 100644 --- a/helpers/content_renderer.go +++ b/helpers/content_renderer.go @@ -45,7 +45,7 @@ func (renderer *HugoHTMLRenderer) BlockCode(out *bytes.Buffer, text []byte, lang } func (renderer *HugoHTMLRenderer) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) { - if renderer.LinkResolver == nil || bytes.HasPrefix(link, []byte("{#{#HUGOSHORTCODE")) { + if renderer.LinkResolver == nil || bytes.HasPrefix(link, []byte("{-{-HUGOSHORTCODE")) { // Use the blackfriday built in Link handler renderer.Renderer.Link(out, link, title, content) } else { @@ -59,7 +59,7 @@ func (renderer *HugoHTMLRenderer) Link(out *bytes.Buffer, link []byte, title []b } } func (renderer *HugoHTMLRenderer) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) { - if renderer.FileResolver == nil || bytes.HasPrefix(link, []byte("{#{#HUGOSHORTCODE")) { + if renderer.FileResolver == nil || bytes.HasPrefix(link, []byte("{-{-HUGOSHORTCODE")) { // Use the blackfriday built in Image handler renderer.Renderer.Image(out, link, title, alt) } else { |