Project

General

Profile

Actions

Patch #43745

closed

Move parse_hires_images and parse_inline_attachments to scrubbers

Patch #43745: Move parse_hires_images and parse_inline_attachments to scrubbers

Added by Marius BĂLTEANU 10 months ago. Updated 7 months ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:

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 2 (1 open — 1 closed)

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

Updated by Marius BĂLTEANU 10 months ago Actions #1

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.

Updated by Marius BĂLTEANU 10 months ago Actions #2

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

Updated by Marius BĂLTEANU 10 months ago Actions #3

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

Updated by Marius BĂLTEANU 10 months ago Actions #4

user:tohosaku, I've added you as watcher to this issue because is on top of your work.

Updated by Marius BĂLTEANU 10 months ago Actions #5

  • Status changed from New to Resolved
  • Assignee set to Marius BĂLTEANU

Change committed, I just need to adapt the tests.

Updated by Marius BĂLTEANU 9 months ago Actions #6

  • Target version changed from Candidate for next major release to 7.0.0

Updated by Marius BĂLTEANU 9 months ago Actions #7

  • Status changed from Resolved to Closed

Refactored the tests, please let me know if you see any issue.

Updated by Go MAEDA 7 months ago Actions #8

  • Subject changed from Move parse_hire_images and parse_inline_attachments to scrubbers to Move parse_hires_images and parse_inline_attachments to scrubbers
Actions

Also available in: PDF Atom