Problem/Motivation

Currently the module theme pickups the rendered HTML and pass it to template as seen here. This is known as early render.

While this might suffice for simple needs, at least not totally broken, it causes 2 not-so-obvious issues:

  • data:image/svg placeholder is stripped out by the render engine causing 404 as being read by browsers https://../image/svg. Note, the missing data: scheme. This issue is pretty similar to Views Rewrite result as noted at Blazy project home. This issue was worked around by JS, but not optimal at subsequent AJAX loaded contents.
  • Any HTML tags are stripped out by Renderer via Xss::filterAdmin, the most obvious is button which are used by Slick navigation. Other HTML remains intact. This issue can be resolved with #allowed_tags, but may require more future checks with unknown HTML tags which are normally passed via caption fields.

Proposed resolution

Consider refactoring the module #pre_render to take over original #pre_render so to avoid the early render problem.

Remaining tasks

Write patch, review.

User interface changes

None.

API changes

None.

Data model changes

None.

CommentFileSizeAuthor
#2 3243726-refactor-prerender-2.patch9.98 KBgausarts

Comments

gausarts created an issue. See original summary.

gausarts’s picture

Category: Task » Bug report
Status: Active » Needs review
StatusFileSize
new9.98 KB

Initial attempts.

  • gausarts committed f360172 on 8.x-1.x
    Issue #3243726 by gausarts: Refactor #pre_render to avoid early render
    
gausarts’s picture

Status: Needs review » Fixed

Improvements may follow as usual. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.