Update heading rules
This commit is contained in:
@@ -148,8 +148,7 @@ export class HighlightedMarkdown extends Component {
|
|||||||
{
|
{
|
||||||
shouldProcessNode: (node) => /^h[123456]$/.test(node.name),
|
shouldProcessNode: (node) => /^h[123456]$/.test(node.name),
|
||||||
processNode(node, children, index) {
|
processNode(node, children, index) {
|
||||||
let currentLevel = +node.name[1];
|
const currentLevel = Math.min(+node.name[1] + 2, 5);
|
||||||
if (currentLevel < 3) currentLevel = 3;
|
|
||||||
const HeadingTag = `h${currentLevel}`;
|
const HeadingTag = `h${currentLevel}`;
|
||||||
return <HeadingTag key={index}>{children}</HeadingTag>;
|
return <HeadingTag key={index}>{children}</HeadingTag>;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user