1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-21 21:51:48 +00:00

fix the bug when using markdown syntax h1

This commit is contained in:
Sosuke Suzuki
2017-04-26 18:14:29 +09:00
parent 75b2c7bd2e
commit 6b8488ae0f

View File

@@ -69,9 +69,10 @@ class MarkdownNoteDetail extends React.Component {
for (let i = 0; i < splitted.length; i++) {
let trimmedLine = splitted[i].trim()
let trimmedNextLine = splitted[i + 1].trim()
if (trimmedLine.match('```')) {
isMarkdownInCode = !isMarkdownInCode
} else if (isMarkdownInCode === false && trimmedLine.match(/^# +/)) {
} else if (isMarkdownInCode === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match('='))) {
title = trimmedLine.substring(1, trimmedLine.length).trim()
break
}