1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

fix the bug that is markdown titile starts with second letter

This commit is contained in:
Sosuke Suzuki
2017-04-26 18:32:46 +09:00
parent 6b8488ae0f
commit 11f7fcbaef

View File

@@ -73,7 +73,11 @@ class MarkdownNoteDetail extends React.Component {
if (trimmedLine.match('```')) {
isMarkdownInCode = !isMarkdownInCode
} else if (isMarkdownInCode === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match('='))) {
if (trimmedNextLine.match('=')) {
title = trimmedLine.substring(0, trimmedLine.length).trim()
} else {
title = trimmedLine.substring(1, trimmedLine.length).trim()
}
break
}
}