Skip to content

fix(packages): render Markdown on provider View Details - #17001

Open
Ibochkarev wants to merge 2 commits into
modxcms:3.xfrom
Ibochkarev:fix/15329-package-details-markdown
Open

fix(packages): render Markdown on provider View Details#17001
Ibochkarev wants to merge 2 commits into
modxcms:3.xfrom
Ibochkarev:fix/15329-package-details-markdown

Conversation

@Ibochkarev

Copy link
Copy Markdown
Collaborator

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 ## Setup headings instead of formatted HTML.

I added PackageMarkdown (Parsedown with safeMode) and run it in Workspace/Packages/Rest/GetList for provider list/details payloads. Local GetAttribute reuses the same helper for transport attributes. Provider license stays plain text for the Information aside. CSS for code / pre / img now also applies under #modx-package-browser-details-main.

How to test

  1. Manager → Extras → Installer → Download Extras (modx.com).
  2. Search Omise, open View Details.
  3. Description should show a real link to omise.co, not [Omise](https://www.omise.co).
  4. Instructions should show headings (Setup, Customising the Payment Form) and a styled code block.
  5. Aside License should still read as a short plain string (e.g. GPLv2), not wrapped in <p>.
  6. Install flow: open Readme / Changelog / License tabs on a local package and confirm Markdown still renders.
php -l core/src/Revolution/Transport/PackageMarkdown.php
php -l core/src/Revolution/Processors/Workspace/Packages/GetAttribute.php
php -l core/src/Revolution/Processors/Workspace/Packages/Rest/GetList.php
# exit 0

core/vendor/bin/phpcs --standard=phpcs.xml \
  core/src/Revolution/Transport/PackageMarkdown.php \
  core/src/Revolution/Processors/Workspace/Packages/GetAttribute.php \
  core/src/Revolution/Processors/Workspace/Packages/Rest/GetList.php \
  _build/test/Tests/Model/Transport/PackageMarkdownTest.php
# exit 0

core/vendor/bin/phpunit -c _build/test/phpunit.xml --filter PackageMarkdownTest
# exit 0 (4 tests, 12 assertions)

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/parsedown dependency. Compiled default theme CSS updated from _package-management.scss.

Breaking change assessment

Workspace/Packages/Rest/GetList now returns HTML for description, instructions, and changelog instead of raw Markdown/plain text. The manager Ext templates already inject those fields as HTML. Short license strings 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 leave license plain, 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 / instructions Markdown) and ran the Gate E commands above before opening the PR.

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.
@Ibochkarev Ibochkarev added bug The issue in the code or project, which should be addressed. area-packages Issues, related to package management and workspaces labels Aug 17, 2026
Source SCSS stays; theme CSS is rebuilt at release, not in this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-packages Issues, related to package management and workspaces bug The issue in the code or project, which should be addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Format markdown on "view details" page in the package manager

1 participant