Created
August 16, 2020 01:03
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{- $markdown := .Inner | markdownify -}} | |
{{ if not ( findRE "<[h|p][^>]*>" $markdown ) }} | |
<p>{{ $markdown }}</p> | |
{{ else }} | |
{{ $markdown }} | |
{{ end }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
todo convert this to a shortcode or something