mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-02 19:28:14 +08:00
docs(build): optimize the regular (#11812)
* docs(build): optimize the regular * chore: rename firstSubheader to firstHeader * docs(build): optimize the regular
This commit is contained in:
parent
b38607f53b
commit
a842504164
@ -58,9 +58,14 @@ const combineMarkdown = (
|
||||
headers: string[],
|
||||
footers: string[]
|
||||
) => {
|
||||
const frontmatterEnds = code.indexOf('---\n\n') + 4
|
||||
const firstSubheader = code.search(/\n## \w/)
|
||||
const sliceIndex = firstSubheader < 0 ? frontmatterEnds : firstSubheader
|
||||
const frontmatterEnds = code.indexOf('---\n\n')
|
||||
const firstHeader = code.search(/\n#{1,6}\s.+/)
|
||||
const sliceIndex =
|
||||
firstHeader < 0
|
||||
? frontmatterEnds < 0
|
||||
? 0
|
||||
: frontmatterEnds + 4
|
||||
: firstHeader
|
||||
|
||||
if (headers.length > 0)
|
||||
code =
|
||||
|
Loading…
Reference in New Issue
Block a user