Преглед на файлове

Merge pull request #9938 from marthacryan/toc-regex

Fix ToC markdown bug for HTML comments
Steven Silvester преди 4 години
родител
ревизия
f981596b95
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  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