Support mmark (replace <hr> by <hr />)

Mmark produces "<hr>" while blackfriday produces "<hr />". A simple
replace allows to support both.
This commit is contained in:
Kostas Chatzikokolakis
2019-09-05 18:59:31 +03:00
parent 3788609d23
commit 637b22ac18
2 changed files with 3 additions and 0 deletions
+2
View File
@@ -4,6 +4,8 @@
{{- if ne (len .Content) 0 -}}
<!-- Remove the <hr /> tag generated by blackfriday for footnotes -->
{{- $content := replace .Content "<div class=\"footnotes\">\n\n<hr />" "<div class=\"footnotes\">" -}}
<!-- Support both <hr /> (blackfriday) and <hr> (mmark) -->
{{- $content := replace $content "<hr>" "<hr />" -}}
<!-- Split the processed content by <hr /> tag -->
{{- range (split $content "<hr />") -}}
<!-- Only wrap in <section> tag if not already wrapped by shortcode -->
+1
View File
@@ -8,6 +8,7 @@
{{- $markdownContent = index $markdownContent $dataPath -}}
{{- end -}}
{{- $html := $markdownContent | markdownify -}}
{{- $html := replace $html "<hr>" "<hr />" -}}
{{- $slides := split $html "<hr />" -}}
{{- range $slides -}}
{{- $scratch.Add "slides" . -}}