mirror of
https://github.com/Threnklyn/reveal-hugo.git
synced 2026-06-07 14:03:33 +02:00
637b22ac18
Mmark produces "<hr>" while blackfriday produces "<hr />". A simple replace allows to support both.
20 lines
772 B
HTML
20 lines
772 B
HTML
<!-- Use the array of pages passed as a param -->
|
|
{{ range . -}}
|
|
<!-- Don't process empty content files -->
|
|
{{- 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 -->
|
|
{{- if not (in . "data-noprocess") -}}
|
|
<section>
|
|
{{- end -}}
|
|
{{- . | safeHTML -}}
|
|
</section>
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- end }}
|