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

Add a way to disable included Markdown plugins #4484

Open
4 tasks done
lynzrand opened this issue Jan 10, 2025 · 0 comments
Open
4 tasks done

Add a way to disable included Markdown plugins #4484

lynzrand opened this issue Jan 10, 2025 · 0 comments
Labels
build Related to the build system enhancement New feature or request

Comments

@lynzrand
Copy link

Is your feature request related to a problem? Please describe.

VitePress by default contains a couple of plugins in addition to vanilla Markdown rendering. However, some plugins might introduce unexpected features when compared to rendering Markdown without the transformation. This adds complexity to theme writers who don't want to support such features.

For example, the preWrapperPlugin wraps the Markdown code block with an additional level of buttons and titles. It's probably fine for default theme, but for theme writers who do not want to support such features (for theme styling or whatever other reason), this gets into their ways, and they now have to additionally hide all the elements this plugin introduces.

.use(preWrapperPlugin, { codeCopyButtonTitle, hasSingleTheme })

return (
`<div class="language-${lang}${getAdaptiveThemeMarker(options)}${active}">` +
`<button title="${options.codeCopyButtonTitle}" class="copy"></button>` +
`<span class="lang">${lang}</span>` +
fence(...args) +
'</div>'
)

Describe the solution you'd like

Add an option, or some other ways, to disable built-in plugins, especially those that would introduce elements that create additional styling requirements compared to vanilla Markdown rendering results.

Describe alternatives you've considered

Theme creators can hide them using CSS or other methods. This is more of a hack than a proper solution.

Additional context

No response

Validations

@brc-dd brc-dd added enhancement New feature or request build Related to the build system labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the build system enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants