aboutsummaryrefslogtreecommitdiff
path: root/markdown/ast_paragraph_test.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-12-14 17:50:33 +0000
committerAnhgelus Morhtuuzh <william@herges.fr>2025-12-14 17:50:33 +0000
commit3312977ebeff03edc5b1bc1a2f815cad6a1ba7b8 (patch)
tree419617345dba2da3d0b666d5993964ce75904efa /markdown/ast_paragraph_test.go
parent8edad5f9aee4625384485ad07180da751858839c (diff)
parent0c0c6fb6df755d8f53d353e8b941e22a6c474b60 (diff)
Merge pull request '[Feat] Custom replace' (#3) from feat/custom-replace into main
Reviewed-on: https://git.anhgelus.world/anhgelus/small-web/pulls/3
Diffstat (limited to 'markdown/ast_paragraph_test.go')
-rw-r--r--markdown/ast_paragraph_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/markdown/ast_paragraph_test.go b/markdown/ast_paragraph_test.go
index 46dd714..2014ab9 100644
--- a/markdown/ast_paragraph_test.go
+++ b/markdown/ast_paragraph_test.go
@@ -11,3 +11,23 @@ func TestParagraph(t *testing.T) {
t.Errorf("failed, got %s", c)
}
}
+
+func TestParagraph_Replacer(t *testing.T) {
+ opt := &Option{
+ Replaces: map[rune]string{'~': "&thinsp;"},
+ }
+ c, err := Parse("bonsoir", opt)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if c != "<p>bonsoir</p>" {
+ t.Errorf("failed, got %s", c)
+ }
+ c, err = Parse("bonsoir~!", opt)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if c != "<p>bonsoir&thinsp;!</p>" {
+ t.Errorf("failed, got %s", c)
+ }
+}