From c0303a91e6d934e64e294a20c14ae26919c1aae5 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Tue, 21 May 2019 18:14:48 -0400 Subject: [PATCH] better html for quotes and code --- fun.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fun.go b/fun.go index e7ef200..b0d70c8 100644 --- a/fun.go +++ b/fun.go @@ -159,9 +159,9 @@ 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("```\n?((?s:.*?))\n?```") +var re_bigcoder = regexp.MustCompile("```\n?((?s:.*?))\n?```\n?") var re_coder = regexp.MustCompile("`([^`]*)`") -var re_quoter = regexp.MustCompile(`(?m:^> (.*)\n)`) +var re_quoter = regexp.MustCompile(`(?m:^> (.*)\n?)`) func markitzero(s string) string { var bigcodes []string @@ -178,7 +178,7 @@ func markitzero(s string) string { s = re_coder.ReplaceAllStringFunc(s, lilsaver) s = re_bolder.ReplaceAllString(s, "$1$2$3") s = re_italicer.ReplaceAllString(s, "$1$2$3") - s = re_quoter.ReplaceAllString(s, "
$1
") + s = re_quoter.ReplaceAllString(s, "
$1

") lilun := func(s string) string { code := lilcodes[0] lilcodes = lilcodes[1:] @@ -191,7 +191,7 @@ func markitzero(s string) string { return code } s = re_bigcoder.ReplaceAllStringFunc(s, bigun) - s = re_bigcoder.ReplaceAllString(s, "

$1
") + s = re_bigcoder.ReplaceAllString(s, "
$1

") s = re_coder.ReplaceAllString(s, "$1") return s }