fix(tiptap): remove indentation from pretty printed HTML #1791
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The original library that was used to pretty print the HTML does not handle
<img>
tags correctly, resulting in inaccurate indentation and leading to the page not being rendered correctly.This happens because the
<img>
tag is a void tag, but the pretty printer interprets it as an opening of a new tag, causing the rest of the content to become incorrectly indented.Solution
Breaking Changes
Bug Fixes:
-1
(which represents0
, due to a bug in the upstream code). HTML does not require indentation, so this does not affect semantics/rendering.Before & After Screenshots
BEFORE:
AFTER:
Tests
npm run tests
)!run e2e
)Deploy Notes
New dependencies:
html
: library for pretty-printing HTML specificallyNew dev dependencies:
@types/html
: typings for thehtml
packageREMOVED dependencies:
beautify
@types/beautify