Prevent out of bounds error when post has no title
This commit is contained in:
parent
0ddca40529
commit
f933b36170
|
@ -182,6 +182,10 @@ func applyMarkdownSpecial(data []byte, skipNoFollow bool, baseURL string, cfg *c
|
|||
}
|
||||
|
||||
func applyBasicMarkdown(data []byte) string {
|
||||
if len(data) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
mdExtensions := 0 |
|
||||
blackfriday.EXTENSION_STRIKETHROUGH |
|
||||
blackfriday.EXTENSION_SPACE_HEADERS |
|
||||
|
|
|
@ -18,6 +18,7 @@ func TestApplyBasicMarkdown(t *testing.T) {
|
|||
in string
|
||||
result string
|
||||
}{
|
||||
{"empty", "", ""},
|
||||
{"plain", "Hello, World!", "Hello, World!"},
|
||||
{"multibyte", "こんにちは", `こんにちは`},
|
||||
{"bold", "**안녕하세요**", `<strong>안녕하세요</strong>`},
|
||||
|
|
Loading…
Reference in New Issue