fix(packages): render Markdown on provider View Details - #17001
Open
Ibochkarev wants to merge 2 commits into
Open
fix(packages): render Markdown on provider View Details#17001Ibochkarev wants to merge 2 commits into
Ibochkarev wants to merge 2 commits into
Conversation
Provider package description/instructions/changelog were shown as raw Markdown (e.g. Omise). Parse those fields with Parsedown safeMode and reuse the helper for local GetAttribute attributes.
Source SCSS stays; theme CSS is rebuilt at release, not in this PR.
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.
What changed and why
Extras on modx.com ship Markdown in description, instructions, and changelog. On Package Manager → View Details those fields still arrived as raw text, so Omise showed
[Omise](…)links and## Setupheadings instead of formatted HTML.I added
PackageMarkdown(Parsedown withsafeMode) and run it inWorkspace/Packages/Rest/GetListfor provider list/details payloads. LocalGetAttributereuses the same helper for transport attributes. Providerlicensestays plain text for the Information aside. CSS forcode/pre/imgnow also applies under#modx-package-browser-details-main.How to test
[Omise](https://www.omise.co).Setup,Customising the Payment Form) and a styled code block.<p>.Related issue(s)/PR(s)
Resolves #15329
Related: Markdown for local package attributes landed in #13853 / #16829; this extends the same idea to provider View Details.
Compatibility notes
Manager Package Management + modx.com (or other) providers. PHP 8.1+. Uses existing
erusev/parsedowndependency. Compiled default theme CSS updated from_package-management.scss.Breaking change assessment
Workspace/Packages/Rest/GetListnow returns HTML fordescription,instructions, andchangeloginstead of raw Markdown/plain text. The manager Ext templates already inject those fields as HTML. Shortlicensestrings are unchanged. Safe for a patch if only the manager consumes this connector.Test coverage
_build/test/Tests/Model/Transport/PackageMarkdownTest.php— links/headings, field filtering, provider fields leavelicenseplain, safeMode strips raw<script>.Contributors
@muzzwood reported the original need (Omise-style Markdown from the extras form).
AI tool use
Cursor (Composer) drafted
PackageMarkdown, the processor wiring, tests, and this PR body. I checked Omise’s live provider payload (description/instructionsMarkdown) and ran the Gate E commands above before opening the PR.