Skip to content

Evaluate markdown renderer #1783

@spliffone

Description

@spliffone

Decision / evaluation criteria

  • Theming support: The renderer should not ship with heavy, opinionated CSS or fixed styling. It must allow for easy overrides using Siemens Element’s design tokens (CSS variables) or provide style hooks.
  • Framework: Element is intended to be used across different environments. The renderer should ideally be based a vanilla JavaScript library or provide a Web Component wrapper. We should avoid to introduce another framework dependency beside Angular.
  • Syntax highlighting extensibility: Provide mechanism for code block highlighting.
  • GFM (GitHub Flavored Markdown) Compliance: Support for modern standards like tables, task lists, strikethrough, and autolinks.
  • SSR (Server-Side rendering) Support: The renderer must be able to run in a Node.js environment without access to the window or document objects.
  • TypeScript support: The library must provide high-quality, up-to-date Type Definitions (@types) to ensure type safety within the development workflow.
  • Tree-shaking and modularity: Is it possible to import only the parser and specific extensions (e.g., tables, task lists) to minimize the impact on the final bundle size?
  • Math and diagrams: Support for extensions like KaTeX (for mathematical formulas) or Mermaid.js (for charts), which are often required in industrial and engineering documentation.
  • HTML sanitization: A critical security criterion. The renderer must either include a built-in, robust XSS sanitizer or integrate seamlessly with DOMPurify to prevent malicious code injection.
  • License compliance: MIT, Apache 2.0, or BSD. Avoid "copyleft" licenses (like GPL) that could complicate the distribution of proprietary software.
  • Maintenance and security: Check the frequency of updates and the speed of patching CVEs (Common Vulnerabilities and Exposures). A library with zero-dependency or a small dependency tree is preferred.
  • A11y conform: Ensures the generated content meets WCAG standards.
  • ECMAScript modules bundle: ESM allow modern build tools to perform static analysis to detect unused code and "shake it out"

Alternative

Candidates

marked + marked-highlight markdown-it showdown micromark remark
Last release Latest Release NPM Version Latest Release Latest Release Latest Release
Last release date Latest Release Date NPM Last Update Latest Release Date Latest Release Date Latest Release Date
Last commit Last Commit Last Commit Last Commit Last Commit Last Commit
Weekly downloads npm weekly downloads npm weekly downloads npm weekly downloads npm weekly downloads npm weekly downloads

Metadata

Metadata

Assignees

Labels

in-analysisThe topic needs to be analyzed by our team

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions