diff --git a/docs/manual.txt b/docs/manual.txt index af30199..4328ed5 100644 --- a/docs/manual.txt +++ b/docs/manual.txt @@ -3,7 +3,11 @@ Instructions for running of the honk. -- posting -Should work as expected. Supports **bold** and *italics*. +Should work as expected. + +Limited markdown support: + **bold** and *italics* + `code` and ```code block``` Large images are rescaled and reduced. diff --git a/fun.go b/fun.go index 2003b4e..aabd918 100644 --- a/fun.go +++ b/fun.go @@ -156,10 +156,14 @@ func herdofemus(noise string) []Emu { var re_bolder = regexp.MustCompile(`(^|\W)\*\*([\w\s,.!?']+)\*\*($|\W)`) var re_italicer = regexp.MustCompile(`(^|\W)\*([\w\s,.!?']+)\*($|\W)`) +var re_bigcoder = regexp.MustCompile("```((?s:.*?))```") +var re_coder = regexp.MustCompile("`(.*?)`") func markitzero(s string) string { s = re_bolder.ReplaceAllString(s, "$1$2$3") s = re_italicer.ReplaceAllString(s, "$1$2$3") + s = re_bigcoder.ReplaceAllString(s, "
$1
")
+ s = re_coder.ReplaceAllString(s, "$1
")
return s
}