-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
markdown-it渲染规则配置失效 #305
Labels
bug
Something isn't working
Comments
这边在这个示例中尝试好像没有类似的提示。 方便的提供一下你的扩展代码,和一个还原你问题的环境 |
我这边是重定义了blockquote_open和blockquote_close的规则,我刚刚测试了一下,似乎是4.0.3版本之后我自定义的blockquote_open规则被覆盖了,而blockquote_close没被覆盖,nuxt的水合错误应该是重定义的blockquote_close规则替换了 修改示例中app.vue的代码如下可以复现 <template>
<MdPreview :model-value="text" />
</template>
<script setup>
import { ref } from 'vue';
import { MdPreview, config } from 'md-editor-v3';
import 'md-editor-v3/lib/style.css';
const text = ref('> test');
config({
markdownItConfig(mdit) {
mdit.renderer.rules.blockquote_open = (tokens, idx) => {
console.log("blockquote_open")
return '<blockquote>'
}
mdit.renderer.rules.blockquote_close = (tokens, idx) => {
console.log("blockquote_close")
console.log(tokens)
return '</blockquote>'
}
},
})
</script> |
我在 yarn add md-editor-v3@beta 正式版会在其它问题修复后一起更新。 |
非常感谢,测试版中没问题了 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
描述这个Bug
我使用了markdown-it的自定义渲染规则来实现一些自定义的语法,但从4.0.3开始的版本就失效了,并且我使用的是nuxt3,在服务端渲染的时候还会出现许多水合错误,而这在4.0.2版本及以前都没有问题的
版本号
4.0.3及以上
问题重现链接
No response
The text was updated successfully, but these errors were encountered: