Skip to content
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

feat: 代码编辑器中增加新属性previewStyleClass用于实现自定义高亮代码主题。#1861 #1863

Closed
wants to merge 2 commits into from

Conversation

aolinpk
Copy link
Collaborator

@aolinpk aolinpk commented May 29, 2024

image

@GreatZPP
Copy link
Member

GreatZPP commented May 29, 2024

这里是否可以直接组件上写class即可,如

<d-md-render :content="content" class="my-class" base-url="https://test-base-url"></d-md-render>

设置样式时类比现在提供的api形式即可

.my-calss .hljs-literal {
   color: blue;
}

如果这里将dp-md-view覆盖,整个编辑器渲染的样式都会被清理,如果需要实现自定义代码高亮,使用自定义渲染,覆盖MarkdownIt对于highlight的配置, 传入customRendererRules即可,可参考md-render-service中的渲染部分设置

@aolinpk
Copy link
Collaborator Author

aolinpk commented May 30, 2024

原目的就是为了全部清理MD渲染部分的样式。如果保留原始类中默认写死的样式,还需要额外写css去覆盖。既然class可以透传到这个位置,那就有其他方案可以处理。不需要加额外的属性了。本个pr可以关闭了

@aolinpk aolinpk closed this May 30, 2024
@aolinpk aolinpk deleted the aolinpk/fix-MarkdownMD branch May 30, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants