feat(cherry-markdown): add IsSupportMath parameter#470
Merged
Conversation
|
Thanks for your PR, @j4587698. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's GuideUpgrades the CherryMarkdown component to leverage the new core build, streamline initialization with spread options, and optionally render mathematical formulas via KaTeX when the new UseKatex flag is enabled. Sequence Diagram: Conditional KaTeX Resource Loading and InitializationsequenceDiagram
participant CM_JS as CherryMarkdown.razor.js
participant Browser as Browser/DOM
participant Cherry as Cherry Engine
CM_JS->>CM_JS: Receives options (including useKatex)
alt options.useKatex is true
CM_JS->>Browser: addScript('./_content/BootstrapBlazor.CherryMarkdown/js/katex.min.js')
activate Browser
Browser-->>CM_JS: KaTeX JS loaded
deactivate Browser
CM_JS->>Browser: addLink('./_content/BootstrapBlazor.CherryMarkdown/css/katex.min.css')
activate Browser
Browser-->>CM_JS: KaTeX CSS loaded
deactivate Browser
CM_JS->>CM_JS: Configure options.engine for KaTeX
CM_JS->>CM_JS: Configure options.externals for KaTeX (window.katex)
end
CM_JS->>Cherry: new Cherry({...options})
activate Cherry
Note right of Cherry: Initialized with relevant options
deactivate Cherry
Class Diagram: Updates to CherryMarkdown Component ClassesclassDiagram
class CherryMarkdown {
+bool UseKatex ## (New Parameter)
#OnInitialized() ## (Modified to pass UseKatex to options)
}
class CherryMarkdownOption {
+bool UseKatex ## (New Property)
}
CherryMarkdown ..> CherryMarkdownOption : uses/configures
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Co-Authored-By: j4587698 <24642446+j4587698@users.noreply.github.com>
ArgoZhang
approved these changes
Jun 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #469
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enable formula support in CherryMarkdown by introducing a UseKatex flag that loads KaTeX assets and configures the markdown engine, while upgrading to cherry-markdown.core.js and consolidating editor options.
New Features:
Enhancements: