Project

General

Profile

Actions

Feature #35035

open

Refactor text formatting to HTML::Pipeline

Added by Martin Cizek over 3 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Text formatting
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

After merging the CommonMark patch #32424, Redmine will contain an HTML::Pipeline implementation limited to this new format. It makes then perfect sense to extend the new concept to text formatting generally.

The current implementation looks like:

While the new Markdown (CommonMark) implementation is designed like:

Migrating text rendering to HTML::Pipeline should provide several benefits:
  • Better separation of concerns.
  • Cleaner, safer and DRY code.
  • Individual formatters can be freed from excessive restrictions that were introduced as XSS prevention. Especially the absolute prohibition of HTML tags can be pain in specific cases.
  • More consistent behavior among formatters (e.g. HTML is currently escaped in Textile, but dropped in Markdown),
  • Controlled level of security without the need to rely on individual formatter implementations that often use poorly maintained libraries.
  • More flexibility for Redmine developers and Redmine plugin developers. Adding some hooks would be nice and would allow e.g. implementing mermaid charts as a custom syntax highlighter - in the same way as GitLab.

Some inspiration can be found in GitLab sources, but our pipelines would probably won't need to go that complex.

If there were no other timing considerations, it would make sense to implement this together with Redcarpet removal.


Files


Related issues

Related to Redmine - Feature #32424: CommonMark Markdown Text FormattingClosedMarius BĂLTEANU

Actions
Actions

Also available in: Atom PDF