Skip to content

Commit

Permalink
fix: support verbatim code-block with syntax specified (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
ae-govau authored Apr 28, 2024
1 parent 8be637b commit 8d74ff8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ func readFile(filename string) (e Entry) {
}

trimmedText := strings.TrimSpace(sc.Text())
if !verbatim && trimmedText == "```" {
if !verbatim && strings.HasPrefix(trimmedText, "```") {
// start new paragraph
if sect != "" {
text = append(text, sect)
}
sect = "```"
sect = trimmedText
verbatim = true
continue
}
Expand Down
3 changes: 3 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,16 @@ https://github.com/restic/restic/pull/666666
{
`Enhancement: foo bar subject
` + "```bash\necho 'test code block with type'\n```" + `
https://github.com/restic/restic/issues/12345
https://github.com/restic/rest-server/issues/232323
https://github.com/restic/restic/pull/666666
https://forum.restic.net/t/getting-last-successful-backup-time/531
`,
Entry{
Title: "Foo bar subject",
Paragraphs: []string{"```bash\necho 'test code block with type'\n```"},
Type: "Enhancement",
TypeShort: "Enh",
PrimaryID: 12345,
Expand Down

0 comments on commit 8d74ff8

Please # to comment.