@hashicorp/remark-plugins
Advanced tools
Comparing version 4.1.0-canary.0 to 4.1.0-canary.1
{ | ||
"name": "@hashicorp/remark-plugins", | ||
"description": "A potpourri of remark plugins used to process .mdx files", | ||
"version": "4.1.0-canary.0", | ||
"version": "4.1.0-canary.1", | ||
"author": "Jeff Escalante", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/hashicorp/remark-plugins/issues", |
@@ -50,10 +50,9 @@ const generateSlug = require('../../generate_slug') | ||
if (isHtmlOrJsxNode) { | ||
node.value.split('\n').forEach((nodeLine) => { | ||
// Using `startsWith` enables seamlessly supporting future props | ||
if (nodeLine.startsWith('<Tabs')) { | ||
tabbedSectionDepth += 1 | ||
} else if (nodeLine === '</Tabs>') { | ||
tabbedSectionDepth -= 1 | ||
} | ||
}) | ||
// Note that a single HTML node could potentially contain multiple tags | ||
const openTagMatches = node.value.match(/\<Tabs/g) | ||
const openTagCount = openTagMatches ? openTagMatches.length : 0 | ||
tabbedSectionDepth += openTagCount | ||
const closeTagMatches = node.value.match(/\<\/Tabs/g) | ||
const closeTagCount = closeTagMatches ? closeTagMatches.length : 0 | ||
tabbedSectionDepth -= closeTagCount | ||
} | ||
@@ -60,0 +59,0 @@ |
61467
610