Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix: smarter typeit shortcode
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonzq committed Aug 10, 2019
1 parent 0882180 commit a8bb44d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions layouts/shortcodes/typeit.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
{{ $content = trim $content "\n" }}
{{ $content = replaceRE `\n</span>` "</span>\n" $content }}
{{ $content = replaceRE `(?m)^(<span.*?>)(.*?)\[(.*?)\]\((.*?)\)(.*?)(</span>)` "$1$2$6<a href=$4>$3</a>$1$5$6" $content }}
{{ $content = replaceRE `(?m)^( +)<span` "<span class=space>$1</span><span" $content }}
{{ $content = replaceRE `</span>( +)<span` "</span><span class=space>$1</span><span" $content | replaceRE `\n` "<br />" }}
{{ $content = replaceRE ` ` "&nbsp;" $content | replaceRE `(<\w+)&nbsp;` "$1 " | replaceRE `\n` "<br />" }}
<div id={{ printf "r%s" $id }} hidden=true>{{ $content | safeHTML }}</div>
<div class={{ .Get "class" | default "typeit-code" }} id={{ $id }}></div>
{{ else }}
Expand Down

0 comments on commit a8bb44d

Please sign in to comment.