Skip to content

Commit 998eef2

Browse files
jmooringbep
authored andcommitted
readme: Update passthrough example
1 parent dac9132 commit 998eef2

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

‎README.md‎

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,38 @@ import (
6262
)
6363

6464
func main() {
65-
inlineDelimiters := []passthrough.Delimiters{
66-
{Open: "\\(", Close: "\\)"},
67-
}
68-
blockDelimiters := []passthrough.Delimiters{
69-
{Open: "\\[", Close: "\\]"},
70-
{Open: "$$", Close: "$$"},
71-
}
72-
7365
md := goldmark.New(
7466
goldmark.WithExtensions(
75-
passthrough.NewPassthroughWithDelimiters(
76-
inlineDelimiters,
77-
blockDelimiters,
67+
passthrough.New(
68+
passthrough.Config{
69+
InlineDelimiters: []passthrough.Delimiters{
70+
{
71+
Open: "$",
72+
Close: "$",
73+
},
74+
{
75+
Open: "\\(",
76+
Close: "\\)",
77+
},
78+
},
79+
BlockDelimiters: []passthrough.Delimiters{
80+
{
81+
Open: "$$",
82+
Close: "$$",
83+
},
84+
{
85+
Open: "\\[",
86+
Close: "\\]",
87+
},
88+
},
89+
},
7890
)),
7991
)
8092

8193
input := `
82-
block \[a^*=x-b^*\] snippet
94+
block $$a^*=x-b^*$$ snippet
8395
84-
inline \(a^*=x-b^*\) snippet
96+
inline $a^*=x-b^*$ snippet
8597
`
8698

8799
var buf bytes.Buffer

0 commit comments

Comments
 (0)