Skip to content

Conversation

Mister-Hope
Copy link
Member

No description provided.

@coveralls
Copy link

coveralls commented May 29, 2025

Pull Request Test Coverage Report for Build 15387494683

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 59.517%

Totals Coverage Status
Change from base Build 15374105783: 0.0%
Covered Lines: 1358
Relevant Lines: 2058

💛 - Coveralls

@Mister-Hope Mister-Hope requested a review from pengzhanbo May 29, 2025 07:43
@Mister-Hope
Copy link
Member Author

Plz review this and improve it's style.

@Mister-Hope Mister-Hope marked this pull request as ready for review May 29, 2025 07:50
@pengzhanbo
Copy link
Member

The content has not been rendered correctly.

QQ_1748587853687

QQ_1748587874306

@Mister-Hope
Copy link
Member Author

Mister-Hope commented Jun 1, 2025

Nice style, I still have some todos in my sight:

  1. Enlarge the clickable area of toggle button, as currently it does not satisfy a11y requirement.
  2. Merge show/hide code i18n to toggle code
  3. Make the toggle button keyboard interactive.

@Mister-Hope Mister-Hope requested review from Copilot and pengzhanbo and removed request for pengzhanbo June 2, 2025 08:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new VuePress plugin for previewing Markdown content (@vuepress/plugin-markdown-preview), including rendering logic, styles, client integration, and documentation updates.

  • Introduce plugin-markdown-preview under plugins/markdown, with node and client code
  • Add SCSS/CSS variables, Vue components, and Markdown-It demo integration
  • Update docs, sidebar, and site config to include the new plugin

Reviewed Changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
plugins/markdown/plugin-markdown-preview/src/shared/index.ts Re-export shared locale types
plugins/markdown/plugin-markdown-preview/src/node/preview.ts Implement preview container rendering via Markdown-It
plugins/markdown/plugin-markdown-preview/src/node/options.ts Define plugin options interface
plugins/markdown/plugin-markdown-preview/src/node/markdownPreviewPlugin.ts Main plugin registration and locale setup
plugins/markdown/plugin-markdown-preview/src/node/locales.ts Default locale entries for preview toggle
plugins/markdown/plugin-markdown-preview/src/node/index.ts Node entry exports
plugins/markdown/plugin-markdown-preview/src/client/styles/vp-preview.scss Styles for preview component
plugins/markdown/plugin-markdown-preview/src/client/styles/vars.css CSS variables for preview
plugins/markdown/plugin-markdown-preview/src/client/index.ts Client entry exports
plugins/markdown/plugin-markdown-preview/src/client/config.ts Client configuration (Vue component registration)
plugins/markdown/plugin-markdown-preview/src/client/components/index.ts Component exports for VPPreview
plugins/markdown/plugin-markdown-preview/src/client/components/VPPreview.ts Vue component definition for preview
plugins/markdown/plugin-markdown-preview/rollup.config.ts Rollup bundling configuration
plugins/markdown/plugin-markdown-preview/package.json Plugin metadata and dependencies
docs/zh/plugins/markdown/markdown-preview.md Chinese documentation for the plugin
docs/plugins/markdown/markdown-preview.md English documentation for the plugin
docs/package.json Register new plugin as a workspace dependency
docs/.vuepress/configs/sidebar/zh.ts Add plugin page to Chinese sidebar
docs/.vuepress/configs/sidebar/en.ts Add plugin page to English sidebar
docs/.vuepress/configs/plugins.ts Enable plugin in example site config
Comments suppressed due to low confidence (1)

plugins/markdown/plugin-markdown-preview/src/shared/index.ts:1

  • The syntax export type * from './locales.js' is invalid. Use export * from './locales.js' or explicitly list type exports with export type { ... } from './locales.js'.
export type * from './locales.js'

white-space: nowrap;
}

.vp-preview-toggle-button {
Copy link

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The selector .vp-preview-toggle-button is defined twice (lines 51–68 and 121–123). Consider merging these blocks to reduce duplication.

Copilot uses AI. Check for mistakes.

}
}

.vp-preview-toggle-button {
Copy link

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] This second definition of .vp-preview-toggle-button only sets the --icon variable; it could be merged with the first block for clarity.

Copilot uses AI. Check for mistakes.

{
'type': 'button',
'class': 'vp-preview-toggle-button',
'title': locale.value.toggle,
Copy link

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding an explicit aria-label attribute alongside title on the toggle button to ensure screen readers announce the control correctly.

Copilot uses AI. Check for mistakes.

openRender: (tokens, index) =>
`<VPPreview title="${escapeHtml(tokens[index].info)}">\n`,
codeRender: (tokens, index, options, _env, self) => {
const token = tokens[index]
Copy link

Copilot AI Jun 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutating the original token can lead to side effects in subsequent render passes. Consider cloning the token before making changes.

Suggested change
const token = tokens[index]
const originalToken = tokens[index]
const token = { ...originalToken }

Copilot uses AI. Check for mistakes.

pengzhanbo
pengzhanbo previously approved these changes Jun 2, 2025
@Mister-Hope Mister-Hope merged commit 85efae6 into main Jun 2, 2025
25 of 26 checks passed
@Mister-Hope Mister-Hope deleted the plugin-preview branch June 2, 2025 11:54
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.

3 participants