Ver Fonte

Merge pull request #9938 from marthacryan/toc-regex

Fix ToC markdown bug for HTML comments
Steven Silvester há 4 anos atrás
pai
commit
f981596b95
1 ficheiros alterados com 1 adições e 1 exclusões
  1. 1 1
      packages/toc/src/utils/parse_heading.ts

+ 1 - 1
packages/toc/src/utils/parse_heading.ts

@@ -88,7 +88,7 @@ function parseHeading(str: string): IHeading | null {
   }
   // Case: Markdown heading (alternative style)
   if (lines.length > 1) {
-    match = lines[1].match(/^([=]{2,}|[-]{2,})/);
+    match = lines[1].match(/^([=]{2,}|[-]{2,})(?<!>)$/);
     if (match) {
       return {
         text: lines[0].replace(/\[(.+)\]\(.+\)/g, '$1'), // take special care to parse Markdown links into raw text