diff --git a/main.go b/main.go index 9cc1cd4..8b239e0 100644 --- a/main.go +++ b/main.go @@ -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 } diff --git a/main_test.go b/main_test.go index 1f277a4..d5e75f3 100644 --- a/main_test.go +++ b/main_test.go @@ -91,6 +91,8 @@ 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 @@ -98,6 +100,7 @@ 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,