Skip to content

Instantly share code, notes, and snippets.

@ryanburnette
Created August 16, 2020 01:03
Show Gist options
  • Save ryanburnette/9c6898493336f849e8280df7c3fd101b to your computer and use it in GitHub Desktop.
Save ryanburnette/9c6898493336f849e8280df7c3fd101b to your computer and use it in GitHub Desktop.
markdownify for getting consistent results when you need a p tag on a single paragraph
{{- $markdown := .Inner | markdownify -}}
{{ if not ( findRE "<[h|p][^>]*>" $markdown ) }}
<p>{{ $markdown }}</p>
{{ else }}
{{ $markdown }}
{{ end }}
@ryanburnette
Copy link
Author

todo convert this to a shortcode or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment