Skip to content

Conversation

Mister-Hope
Copy link
Member

@Mister-Hope Mister-Hope commented May 1, 2025

This PR allow setting 'strict' with size and fixes some wrong documentation introduced by #449. cc @LincZero

@Mister-Hope Mister-Hope requested a review from Copilot May 1, 2025 10:10
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

This PR updates the markdown image plugin to allow a new 'strict' mode for the size option while also fixing related documentation errors.

  • Updated the TypeScript interface in options.ts to support size as boolean or 'strict'.
  • Adjusted the plugin logic to pass additional configuration when size is 'strict'.
  • Revised the documentation in both Chinese and English to clarify the behavior of size and legacy size configurations.

Reviewed Changes

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

File Description
plugins/markdown/plugin-markdown-image/src/node/options.ts Updated the type definition for the size option.
plugins/markdown/plugin-markdown-image/src/node/markdownImagePlugin.ts Modified logic to use the imgSize plugin with strict mode option.
docs/zh/plugins/markdown/markdown-image.md Revised documentation to explain size and legacySize options in Chinese.
docs/plugins/markdown/markdown-image.md Revised documentation to explain size and legacy configuration in English.
Comments suppressed due to low confidence (1)

docs/plugins/markdown/markdown-image.md:113

  • The English documentation references 'legacy: true', but the plugin code uses the 'legacySize' option. Please update the documentation to 'legacySize: true' for consistency.
You can use `=widthxheight` to specify the image size at the end of the link when setting legacy: true in plugin options.

@Mister-Hope Mister-Hope merged commit c1ea524 into main May 1, 2025
23 checks passed
@Mister-Hope Mister-Hope deleted the markdown-img-size branch May 1, 2025 10:12
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.

1 participant