Skip to content

Streaming sanitizer & text node normalization #390

@noamr

Description

@noamr

The sanitizer is currently configured to behave like a post-parsing DOM operation, meaning for example that sanitizing a<!--comment-->b to remove comments would create two text nodes (a and b).

However, when the sanitizer is streaming and works as part of the parser - does that still makes sense?
In the above example, the comment is not inserted in the first place, and therefore when inserting b we get to the insert a character algorithm which tries to compact the text nodes by adding this one to the previous one.

To make the sanitizer behave like post-processing in terms of text nodes, we'd need special behavior in that part of the parser, or some such.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions