vitepress
vitepress copied to clipboard
vitepress can't parse code in xml format.(vitepress解析不了代码格式为xml)
trafficstars
Describe the bug
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-proj</artifactId>
<version>1.0.0</version>
<name>Example Project</name>
<description>This is an example Maven project.</description>
<url>http://www.example.com/</url>
<licenses> <!-- 许可证 -->
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers> <!-- 开发者信息 -->
<developer>
<id>developer1</id>
<name>Developer One</name>
<email>[email protected]</email>
<organization>Example Organizations Inc.</organization>
<organizationUrl>http://www.example-organizations.com/</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>-5</timezone>
</developer>
</developers>
<dependencies> <!-- 依赖项 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.2.1.RELEASE</version>
</dependency>
</dependencies>
<build> <!-- 项目构建 -->
<plugins> <!-- 插件配置 -->
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>com.example.App</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
Reproduction
{ "devDependencies": { "markdown-it-mathjax3": "^4.3.2", "vitepress": "1.2.3", "vue": "3.4.31" }, "scripts": { "docs:dev": "vitepress dev docs", "docs:build": "vitepress build docs", "docs:preview": "vitepress preview docs" }, "dependencies": { "markdown-it-katex": "^2.0.3" } }
Expected behavior
System Info
at createCompilerError (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1328:17)
at emitError (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2812:5)
at Object.onclosetag (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2179:13)
at Tokenizer.stateInClosingTagName (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:749:16)
at Tokenizer.parse (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:1107:16)
at Object.baseParse (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-core\dist\compiler-core.cjs.js:2851:13)
at Object.parse (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-dom\dist\compiler-dom.cjs.js:706:23)
at Object.parse$2 [as parse] (D:\code\vitpress\node_modules\.pnpm\@[email protected]\node_modules\@vue\compiler-sfc\dist\compiler-sfc.cjs.js:1850:24)
at createDescriptor (file:///D:/code/vitpress/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:64:43)
at handleHotUpdate (file:///D:/code/vitpress/node_modules/.pnpm/@[email protected][email protected][email protected]/node_modules/@vitejs/plugin-vue/dist/index.mjs:2160:26)
Additional context
No response
Validations
- [X] Check if you're on the latest VitePress version.
- [X] Follow our Code of Conduct
- [X] Read the docs.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Ah, the stack traces in markdown files are not reliable. Check if some place outside that code block you're using <something> without back ticks or back slashes. That code block doesn't have any issue - https://stackblitz.com/edit/vite-znqsyg?file=docs/index.md