Explorar o código

fix: Exclude commented headers from page contents tree

NGPixel %!s(int64=8) %!d(string=hai) anos
pai
achega
25c105cdc2
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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 = []