issues
search
yuin
/
goldmark-highlighting
A Syntax highlighting extension for the goldmark markdown parser.
MIT License
100
stars
14
forks
source link
Panic when linenostart is a string
#27
Closed
jmooring
closed
2 years ago
jmooring
commented
2 years ago
markdown
~~~text {linenostart="1"} foo ~~~
code
```go package main import ( "bytes" "fmt" "github.com/yuin/goldmark" highlighting "github.com/yuin/goldmark-highlighting" ) func main() { md := goldmark.New( goldmark.WithExtensions( highlighting.Highlighting, ), ) input := ` ~~~text {linenostart="1"} foo ~~~ ` var buf bytes.Buffer if err := md.Convert([]byte(input), &buf); err != nil { panic(err) } fmt.Println(buf.String()) } ```
markdown
code
```go package main import ( "bytes" "fmt" "github.com/yuin/goldmark" highlighting "github.com/yuin/goldmark-highlighting" ) func main() { md := goldmark.New( goldmark.WithExtensions( highlighting.Highlighting, ), ) input := ` ~~~text {linenostart="1"} foo ~~~ ` var buf bytes.Buffer if err := md.Convert([]byte(input), &buf); err != nil { panic(err) } fmt.Println(buf.String()) } ```