Project

General

Profile

Actions

Patch #43745

open

Move parse_hire_images and parse_inline_attachments to scrubbers

Added by Marius BĂLTEANU about 20 hours ago. Updated about 7 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring

Description

#43643 introduced Loofah for textile text formatting and now we can share common scrubbers between all text formatter options.

This patch moves the parse_hire_images and parse_inline_attachments from ApplicationHelper to their own dedicated scrubbers:
  • HiresImagesScrubber
  • InlineAttachmentsScrubber

Both scrubbers work only at img node level and do not require to traverse the HTML tree.

Before:

Textile Average: 7.85 ms
CommonMark Average: 15.94 ms

After:

Textile Average: 8.71 ms
CommonMark Average: 16.58 ms

Files


Related issues

Related to Redmine - Patch #43643: Align the Textile processing approach with CommonMark by using LoofahClosedMarius BĂLTEANUActions
Related to Redmine - Feature #35035: Refactor text formatting to HTML::PipelineNewActions
Actions #1

Updated by Marius BĂLTEANU about 20 hours ago

If this overall approach is accepted, it will require a little bit of extra work in order to adapt the tests to the new structure and maybe to have a Base class that implements post_processor_scrubbers.

Actions #2

Updated by Marius BĂLTEANU about 20 hours ago

  • Related to Patch #43643: Align the Textile processing approach with CommonMark by using Loofah added
Actions #3

Updated by Marius BĂLTEANU about 20 hours ago

  • Related to Feature #35035: Refactor text formatting to HTML::Pipeline added
Actions #4

Updated by Marius BĂLTEANU about 20 hours ago

Takashi Kato, I've added you as watcher to this issue because is on top of your work.

Actions

Also available in: Atom PDF