Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(format/html): resolve some edge cases with whitespace #5148

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented Feb 17, 2025

Summary

This PR aims to resolve some mismatches with prettier preservation of whitespace in whitespace sensitive contexts. It also does some refactoring to help make determining whitespace sensitivity easier.

Test Plan

Snapshots updated.

@github-actions github-actions bot added A-Formatter Area: formatter L-HTML Language: HTML labels Feb 17, 2025
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most notably, this PR resolves the mismatch with prettier for this test case:

<span>123</span>
<span>
123</span>
<span>123
</span>
<span>
123
</span>

<div>123</div>
<div>
123</div>
<div>123
</div>
<div>
123
</div>

@dyc3 dyc3 force-pushed the html-whitespace-quirks branch from 1a9230d to 644a2f7 Compare February 17, 2025 21:19
@dyc3 dyc3 force-pushed the html-whitespace-quirks branch from 644a2f7 to bec640a Compare February 17, 2025 21:21
Copy link

codspeed-hq bot commented Feb 17, 2025

CodSpeed Performance Report

Merging #5148 will not alter performance

Comparing html-whitespace-quirks (bec640a) with main (d739883)

Summary

✅ 94 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Formatter Area: formatter L-HTML Language: HTML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant