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:
@@ -69,9 +69,10 @@ class MarkdownNoteDetail extends React.Component {
|
|||||||
|
|
||||||
for (let i = 0; i < splitted.length; i++) {
|
for (let i = 0; i < splitted.length; i++) {
|
||||||
let trimmedLine = splitted[i].trim()
|
let trimmedLine = splitted[i].trim()
|
||||||
|
let trimmedNextLine = splitted[i + 1].trim()
|
||||||
if (trimmedLine.match('```')) {
|
if (trimmedLine.match('```')) {
|
||||||
isMarkdownInCode = !isMarkdownInCode
|
isMarkdownInCode = !isMarkdownInCode
|
||||||
} else if (isMarkdownInCode === false && trimmedLine.match(/^# +/)) {
|
} else if (isMarkdownInCode === false && (trimmedLine.match(/^# +/) || trimmedNextLine.match('='))) {
|
||||||
title = trimmedLine.substring(1, trimmedLine.length).trim()
|
title = trimmedLine.substring(1, trimmedLine.length).trim()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user