fix(html): resolve validation errors, implement dynamic MDX heading shifting, and improve accessibility
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🧪 QA (push) Successful in 1m30s
Build & Deploy / 🏗️ Build (push) Successful in 2m42s
Build & Deploy / 🚀 Deploy (push) Successful in 39s
Build & Deploy / 🧪 Smoke Test (push) Successful in 51s
Build & Deploy / 🛡️ Quality Gates (push) Failing after 1m24s
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / ♿ WCAG (push) Has been cancelled
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 9s
Build & Deploy / 🧪 QA (push) Successful in 1m30s
Build & Deploy / 🏗️ Build (push) Successful in 2m42s
Build & Deploy / 🚀 Deploy (push) Successful in 39s
Build & Deploy / 🧪 Smoke Test (push) Successful in 51s
Build & Deploy / 🛡️ Quality Gates (push) Failing after 1m24s
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / ♿ WCAG (push) Has been cancelled
This commit is contained in:
@@ -221,10 +221,10 @@ export function getTextContent(node: any): string {
|
||||
}
|
||||
|
||||
export function getHeadings(content: string): { id: string; text: string; level: number }[] {
|
||||
const headingLines = content.split('\n').filter((line) => line.match(/^#{2,3}\s/));
|
||||
const headingLines = content.split('\n').filter((line) => line.match(/^#{1,3}\s/));
|
||||
|
||||
return headingLines.map((line) => {
|
||||
const level = line.match(/^#+/)?.[0].length || 0;
|
||||
const level = (line.match(/^#+/)?.[0].length || 0) + 1; // Shift H1->H2, H2->H3, H3->H4
|
||||
const rawText = line.replace(/^#+\s/, '').trim();
|
||||
const cleanText = rawText.replace(/[*_`]/g, '');
|
||||
const id = generateHeadingId(cleanText);
|
||||
|
||||
Reference in New Issue
Block a user