-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
Describe the bug
If dynamic content contains a MathJax block formula $$ ... $$
, it is styled differently than in a static markdown file:
- Static content:
style="direction: ltr; display: block; text-align: center; margin: 1em 0px; position: relative;"
- Dynamic content with
<!-- @content -->
:
style="direction: ltr; position: relative;"
So the dynamic MathJax formula is not displayed as a block and not centered. Any ideas why?
Reproduction
Code
math-[id].md:
## Static content
$$
a^2 + b^2 = c^2
$$
## Dynamic content via @content
<!-- @content -->
math-[id].paths.ts:
const content = `
$$
a^2 + b^2 = c^2
$$
`;
export default {
paths() {
return [{ params: { id: "pythagoras" }, content: content }];
},
};
Expected behavior
Same styling of static and dynamic content.
System Info
System:
OS: Windows 11 10.0.26100
CPU: (16) x64 AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics
Memory: 15.70 GB / 30.67 GB
Binaries:
Node: 22.11.0 - C:\Program Files\nodejs\node.EXE
npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (131.0.2903.99)
Internet Explorer: 11.0.26100.1882
npmPackages:
vitepress: ^1.5.0 => 1.5.0
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Metadata
Metadata
Assignees
Labels
No labels