プロジェクト

全般

プロフィール

Vote #81373

未完了

Refactor text formatting to HTML::Pipeline

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Text formatting_26
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
26
version_id:
32
issue_org_id:
35035
author_id:
12098
assigned_to_id:
0
comments:
3
status_id:
1
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[New]

説明

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:
!Text_Formatting-Redmine-4.2.png!

While the new Markdown (CommonMark) implementation is designed like:
!CommonMark-HTML_Pipeline.png!

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":https://gitlab.com/gitlab-org/gitlab/-/tree/master/lib/banzai/pipeline, 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.


journals

Totally agree, the potential benefits of switching to html pipeline are quite big. This kind of modularization will allow for many interesting features to be implemented in core or by plugins in the future.

As stated in #32424-37, I'd even like to move the redcarpet renderer to the pipeline, so it could still be used in the future as part of core, or extracted into a plugin, by those unwilling or unable to switch to common mark.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I'm setting this to Candidate for next major release because for sure it is something that we should work on. If you have any working code to start from it, it's welcome.
--------------------------------------------------------------------------------


related_issues

relates,Closed,32424,CommonMark Markdown Text Formatting

Admin Redmine さんが約2年前に更新

  • カテゴリText formatting_26 にセット
  • 対象バージョンCandidate for next major release_32 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0