3 ## markdown to html module for pinopress
4 ## based off https://github.com/stamby/md-to-html
5 # input $1 - filepath to html file
7 # special html characters
13 s/(^|[^\\\*])\*{3}([^\*]+)\*{3}([^\*]|$)/\1<strong><em>\2<\/em><\/strong>\3/g
14 s/(^|[^\\_])_{3}([^_]+)_{3}([^_]|$)/\1<strong><em>\2<\/em><\/strong>\3/g
15 s/(^|[^\\\*])\*{2}([^\*]+)\*{2}([^\*]|$)/\1<strong>\2<\/strong>\3/g
16 s/(^|[^\\_])_{2}([^\_]+)_{2}([^_]|$)/\1<strong>\2<\/strong>\3/g
17 s/(^|[^\\\*])\*([^\*]+)\*([^\*]|$)/\1<em>\2<\/em>\3/g
18 s/(^|[^\\_])_([^_]+)_([^_]|$)/\1<em>\2<\/em>\3/g
19 s/(^|[^\\`])`([^`]+)`([^`]|$)/\1<code>\2<\/code>\3/g
22 s/!\[(.*)\]\((.*)\)/<img src="\2" alt="\1"\/>/g
25 s/\[(.*)\]\((.*)\)/<a href="\1">\2<\/a>/g
26 s/\[(.*)\]/<a href="\1">\1<\/a>/g
29 s/^#{4} (.*)/<h4>\1<\/h4>/
30 s/^#{3} (.*)/<h3>\1<\/h3>/
31 s/^#{2} (.*)/<h2>\1<\/h2>/
32 s/^#} (.*)/<h1>\1<\/h1>/