mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-25 13:19:03 -05:00
fix: mark short code inside mdx pages too
This commit is contained in:
1 parent
153ba479f6
commit
0038533666
1 file changed
+10
@@ -150,5 +150,15 @@ export default function shortCode() {
|
||||
},
|
||||
},
|
||||
],
|
||||
// In an MDX page (one with tabs) inline HTML is JSX: a `<code title>`
|
||||
// hash in a table cell reaches neither raw() nor element. Long JSX code
|
||||
// gets its breaks from site.ts.
|
||||
mdxJsxTextElement: {
|
||||
filter: ['code'],
|
||||
visit(code, ctx) {
|
||||
const named = (code.attributes ?? []).some((attribute) => ['class', 'className'].includes(attribute.name));
|
||||
if (!named && isShort(ctx.textContent(code), false)) ctx.setProperty(code, 'class', 'rb-short');
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user