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: migrate the codePlugin from @vuepress/markdown to plugin-shiki and plugin-prismjs #137

Merged
merged 54 commits into from
May 20, 2024

Conversation

pengzhanbo
Copy link
Member

@pengzhanbo pengzhanbo commented May 15, 2024

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Provide a description in this PR that addresses what the PR is solving. If this PR is going to solve an existing issue, please reference the issue (e.g. close #123).

What is the purpose of this pull request?

  • Bug fix
  • New feature
  • Other

Description

see vuepress/core#1550

Screenshots

Before

After

@coveralls
Copy link

coveralls commented May 15, 2024

Pull Request Test Coverage Report for Build 9156129729

Details

  • 296 of 306 (96.73%) changed or added relevant lines in 20 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+7.3%) to 57.056%

Changes Missing Coverage Covered Lines Changed/Added Lines %
plugins/plugin-prismjs/src/node/parser/notation.ts 32 33 96.97%
plugins/plugin-shiki/src/node/resolveHighlight.ts 26 28 92.86%
plugins/plugin-prismjs/src/node/parser/getCodeParser.ts 42 45 93.33%
plugins/plugin-prismjs/src/node/prismjsPlugin.ts 0 4 0.0%
Totals Coverage Status
Change from base Build 9123655949: 7.3%
Covered Lines: 993
Relevant Lines: 1567

💛 - Coveralls

docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
plugins/plugin-shiki/src/node/highlight.ts Outdated Show resolved Hide resolved
docs/plugins/shiki.md Outdated Show resolved Hide resolved
docs/plugins/shiki.md Show resolved Hide resolved
docs/plugins/shiki.md Outdated Show resolved Hide resolved
docs/plugins/shiki.md Outdated Show resolved Hide resolved
docs/plugins/shiki.md Show resolved Hide resolved
docs/plugins/shiki.md Outdated Show resolved Hide resolved
docs/plugins/shiki.md Outdated Show resolved Hide resolved
Co-authored-by: 张怀文 <[email protected]>
@Mister-Hope
Copy link
Member

Mister-Hope commented May 15, 2024

Also check #135

@pengzhanbo
Copy link
Member Author

Also check #135

It appears that the current shikiSetup() has already implemented the same functionality.

pengzhanbo and others added 2 commits May 16, 2024 00:14
docs/plugins/shiki.md Outdated Show resolved Hide resolved
docs/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
docs/zh/plugins/shiki.md Outdated Show resolved Hide resolved
@pengzhanbo pengzhanbo mentioned this pull request May 16, 2024
@meteorlxy
Copy link
Member

Same here. UT or E2E is required

themes/theme-default/src/client/styles/code.scss Outdated Show resolved Hide resolved
themes/theme-default/src/client/styles/code.scss Outdated Show resolved Hide resolved
plugins/plugin-shiki/src/node/utils.ts Outdated Show resolved Hide resolved
plugins/plugin-shiki/src/node/utils.ts Outdated Show resolved Hide resolved
plugins/plugin-shiki/src/node/types.ts Outdated Show resolved Hide resolved
Mister-Hope
Mister-Hope previously approved these changes May 20, 2024
@Mister-Hope Mister-Hope requested a review from meteorlxy May 20, 2024 06:24
const language = resolveLanguage(info)
const languageClass = `${langPrefix}${language.name}`

const code = fence(...args).replace(/<code[^]*?>/, '<code>')
Copy link
Member

Choose a reason for hiding this comment

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

A little explanation here?

Mister-Hope
Mister-Hope previously approved these changes May 20, 2024
@Mister-Hope Mister-Hope enabled auto-merge (squash) May 20, 2024 08:57
@Mister-Hope Mister-Hope merged commit 49f96cf into main May 20, 2024
32 checks passed
@Mister-Hope Mister-Hope deleted the plugin-shiki branch May 20, 2024 09:01
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.

4 participants