Skip to content

Rewriter: text content longer than 65536 chars is truncated #292

@hedgepigdaniel

Description

@hedgepigdaniel

See minimal reproduction here: https://github.com/hedgepigdaniel/parse5-bug

I tried to find a bug in the parse5-sax-parser but the test I created for it succeeds: https://github.com/inikulin/parse5/compare/master...hedgepigdaniel:test/waterline?expand=1

So I assume that it has something to do with the sourceCodeLocationInfo option passed to the SAXParser by RewritingStream.

An effective workaround is to set RewritingStream().tokenizer.preprocessor.bufferWaterline = Infinity as seen here: https://github.com/hedgepigdaniel/parse5-bug/blob/master/index.js#L7-L8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions