all repos — honk @ ee129cb12c72317e98416536833626ffda4982d1

my fork of honk

`code` and ```code block``` support
Ted Unangst tedu@tedunangst.com
Wed, 08 May 2019 13:08:29 -0400
commit

ee129cb12c72317e98416536833626ffda4982d1

parent

490c069bb66f0163d84a4a6d1693bf11b1ea9525

2 files changed, 9 insertions(+), 1 deletions(-)

jump to
M docs/manual.txtdocs/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.
M fun.gofun.go

@@ -156,10 +156,14 @@ }

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<b>$2</b>$3") s = re_italicer.ReplaceAllString(s, "$1<i>$2</i>$3") + s = re_bigcoder.ReplaceAllString(s, "<pre><code>$1</code></pre>") + s = re_coder.ReplaceAllString(s, "<code>$1</code>") return s }