From 96e99ce6c8419d8052500327f700fed7a4516bca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 21 Feb 2025 00:16:44 +0100 Subject: [PATCH] Make HTML Beautifier fail on nesting errors This way we're also checking mistakes like closing tags that don't match their opening element, which we detected by manually running HTML Beautifier with the `-e` option, and fixed two commits ago. Note there was a false positive in the mailer layout. We don't know the cause. Maybe closing the ERB tag right before the HTML opening tag and the lack of other attributes on the tag made HTML Beautifier think the tag wasn't correctly open, but on the other hand, we have the exact same line in other layouts where HTML Beautifier works fine. We're fixing it by adding an HTML id attribute to the element. --- .github/workflows/linters.yml | 2 +- app/views/layouts/mailer.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index bd96f0541..2b1e72b75 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -22,7 +22,7 @@ jobs: - name: Markdownlint run: bundle exec mdl *.md docs/ - name: HTML Beautifier - run: find app/ -name "*.html.erb" -exec bundle exec htmlbeautifier --lint-only --keep-blank-lines 1 {} + + run: find app/ -name "*.html.erb" -exec bundle exec htmlbeautifier --lint-only --keep-blank-lines 1 -e {} + name: ${{ matrix.name }} steps: - name: Checkout code diff --git a/app/views/layouts/mailer.html.erb b/app/views/layouts/mailer.html.erb index e8ed007d0..6e94ee0ab 100644 --- a/app/views/layouts/mailer.html.erb +++ b/app/views/layouts/mailer.html.erb @@ -1,5 +1,5 @@ -> + id="mailer_layout"> <%= t("mailers.title") %>