Skip to content

Commit eb38780

Browse files
committed
Refined correctHeadings
1 parent 31d6563 commit eb38780

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/app/book/markdown/markdown.service.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ export class MarkdownService {
286286
if(fullPath){
287287
const pathsFromFile: Array<string> = await this.loadSummaryFromFile(_vfile, fullPath);
288288

289-
console.log(pathsFromBackend, pathsFromFile);
290-
291289
// 把从后台获取的 paths 补充到 pathsFromFile 中
292290
pathsFromBackend.map((_: string) => {
293291
if(pathsFromFile.findIndex((__: string) => __ === _) < 0) pathsFromFile.push(_);

src/app/gbr-preset/plugins/frontmatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function correctHeadings(): Transformer {
6666
const text: string = node.children[0].value as string;
6767
const re = new RegExp(/(\#){1,6}([^\#]){1,}/g)
6868

69-
if(re.test(text)){
69+
if(/^(\#){1,6}/.test(text)){
7070
const headings = text.match(re).reduce((acc: Array<Heading>, _: string): Array<Heading> => {
7171
return _ ? [...acc, getHeadingFromStr(_)] : acc;
7272
}, []);

0 commit comments

Comments
 (0)