소스 검색

fix: Exclude commented headers from page contents tree

NGPixel 8 년 전
부모
커밋
25c105cdc2
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      server/libs/markdown.js

+ 1 - 0
server/libs/markdown.js

@@ -94,6 +94,7 @@ const videoRules = [
  * @return     {Array}             TOC tree
  */
 const parseTree = (content) => {
+  content = content.replace(/<!--(.|\t|\n|\r)*?-->/g, '')
   let tokens = md().parse(content, {})
   let tocArray = []