all repos — honk @ 9ab52255236a098266c5b01968a891d06de137bd

my fork of honk

try more aggresive bold matching and hope it doesn't break
Ted Unangst tedu@tedunangst.com
Fri, 25 Oct 2019 00:27:00 -0400
commit

9ab52255236a098266c5b01968a891d06de137bd

parent

11b9fed2bd760a86c413c477b0ea2aa561a11bc5

2 files changed, 8 insertions(+), 3 deletions(-)

jump to
M markitzero.gomarkitzero.go

@@ -24,8 +24,8 @@ "golang.org/x/net/html"

"humungus.tedunangst.com/r/webs/synlight" ) -var re_bolder = regexp.MustCompile(`(^|\W)\*\*([\w\s,.!?':_-]+)\*\*($|\W)`) -var re_italicer = regexp.MustCompile(`(^|\W)\*([\w\s,.!?':_-]+)\*($|\W)`) +var re_bolder = regexp.MustCompile(`(^|\W)\*\*((?s:.*?))\*\*($|\W)`) +var re_italicer = regexp.MustCompile(`(^|\W)\*((?s:.*?))\*($|\W)`) var re_bigcoder = regexp.MustCompile("```(.*)\n?((?s:.*?))\n?```\n?") var re_coder = regexp.MustCompile("`([^`]*)`") var re_quoter = regexp.MustCompile(`(?m:^> (.*)\n?)`)
M markitzero_test.gomarkitzero_test.go

@@ -17,6 +17,12 @@ output := `link to <a class="mention u-url" href="https://example.com/">https://example.com/</a> with <b>bold</b> text`

doonezerotest(t, input, output) } +func TestMultibold(t *testing.T) { + input := `**in** out **in**` + output := `<b>in</b> out <b>in</b>` + doonezerotest(t, input, output) +} + func TestLinebreak1(t *testing.T) { input := "hello\n> a quote\na comment" output := "hello<blockquote>a quote</blockquote><p>a comment"

@@ -72,7 +78,6 @@ doonezerotest(t, input, output)

} func TestBoldLink(t *testing.T) { - t.SkipNow() input := `**b https://example.com/link b**` output := `<b>b <a class="mention u-url" href="https://example.com/link">https://example.com/link</a> b</b>` doonezerotest(t, input, output)