mirror of
https://github.com/writefreely/writefreely
synced 2024-11-10 11:24:13 +00:00
Prevent out of bounds error when post has no title
This commit is contained in:
parent
0ddca40529
commit
f933b36170
2 changed files with 5 additions and 0 deletions
|
@ -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 a new issue