+
Skip to content

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented Feb 7, 2025

Summary

This imports all the HTML tests from prettier into our snapshot tests. It excludes some tests that rely on prettier's infra (eg. the "cursor" tests). At the time of writing, only 4 of prettier's tests outright fail, and a large portion of the imported tests don't match prettier's output.

Caution

This PR is stacked on the following PRs. Do not merge it without merging the others and rebasing this branch. To review this PR, look at the last commit only.

Test Plan

CI should pass except for the 4 tests mentioned above.

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

codspeed-hq bot commented Feb 7, 2025

CodSpeed Performance Report

Merging #5056 will not alter performance

Comparing html-add-prettier-tests (90d257b) with next (56527db)

Summary

✅ 94 untouched benchmarks

@dyc3 dyc3 force-pushed the html-add-prettier-tests branch from 94eadb3 to 5273183 Compare February 7, 2025 19:04
@dyc3
Copy link
Contributor Author

dyc3 commented Feb 7, 2025

Regarding the failing tests:

  • specs::prettier::html::prettier_ignore::issue_15738_html is for handling the (extremely old, deprecated) special <plaintext> tag, where all the content after it is treated as plain text. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/plaintext -- I don't think it's worth the time and effort to support this tag, especially because it's deprecated and removed from web standards.
  • specs::prettier::html::prettier_ignore::unclosed_html and specs::prettier::html::prettier_ignore::unclosed2_html deal with unclosed tags, and test for prettier's ability to not add closing tags when they aren't present in the presence of a prettier ignore comment (requires parser changes)
  • specs::prettier::html::basics::broken_html_html would (probably) also be fixed when the unclosed tests are fixed

@dyc3 dyc3 force-pushed the html-add-prettier-tests branch from 5273183 to 90d257b Compare February 9, 2025 19:19
@dyc3 dyc3 marked this pull request as ready for review February 9, 2025 19:19
@dyc3
Copy link
Contributor Author

dyc3 commented Feb 9, 2025

I've removed the 4 failing tests temporarily because I would rather get these in the repo to help avoid regressions in future PRs, and the underlying issue preventing me from fixing them requires some closer examination.

@dyc3 dyc3 requested review from a team February 9, 2025 19:23
@dyc3 dyc3 merged commit 8379a60 into next Feb 10, 2025
12 checks passed
@dyc3 dyc3 deleted the html-add-prettier-tests branch February 10, 2025 00:49
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.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载