Skip to content

package.json: Switch to markdown-to-jsx - #23352

Draft
jelly wants to merge 1 commit into
cockpit-project:mainfrom
jelly:alternative-markdown
Draft

package.json: Switch to markdown-to-jsx#23352
jelly wants to merge 1 commit into
cockpit-project:mainfrom
jelly:alternative-markdown

Conversation

@jelly

@jelly jelly commented Jun 4, 2026

Copy link
Copy Markdown
Member

The PackageKit UpdateDetail signal provides markdown in the update_text and uses remarkable to parse the markdown contents.

Remarkable however has not been updated since 6 years, additionally it requires us to use dangerouslySetInnerHTML which can lead to XSS issues.

The npm ecosystem has two other markdown alternatives react-markdown and a markdown-to-jsx. The latter has zero dependencies while react-markdown has eleven and requires additional plugins like rehype-external-links to add a rel/target to external links.

https://www.freedesktop.org/software/PackageKit/gtk-doc/Transaction.html jonschlinkert/remarkable#438

The PackageKit UpdateDetail signal provides markdown in the
`update_text` and uses remarkable to parse the markdown contents.

Remarkable however has not been updated since 6 years, additionally it
requires us to use `dangerouslySetInnerHTML` which can lead to XSS
issues.

The npm ecosystem has two other markdown alternatives `react-markdown`
and a `markdown-to-jsx`. The latter has zero dependencies while
`react-markdown` has eleven and requires additional plugins like
`rehype-external-links` to add a rel/target to external links.

https://www.freedesktop.org/software/PackageKit/gtk-doc/Transaction.html
jonschlinkert/remarkable#438
@jelly

jelly commented Jun 4, 2026

Copy link
Copy Markdown
Member Author
Error: package 'node_modules/markdown-to-jsx' contains architecture dependent files, cannot include in runtime tarball

@jelly

jelly commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

Current issue is:

node_modules/markdown-to-jsx/dist/index.js.map:              application/json; charset=utf-8
node_modules/markdown-to-jsx/dist/markdown.cjs:              application/octet-stream; charset=binary
[jelle@carbon][~/projects/cockpit/alternative-markdown]%head -n 4 node_modules/markdown-to-jsx/dist/native.js
import*as z9 from"react";import{Image as ZJ,Linking as o6,Text as J9,View as o0}from"react-native"

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