Don’t allow paragraphs without class attribute

All paragraphs should have class="govuk-body", or be otherwise
custom-styled. This commit adds some extra checks to our test fixture
that looks for paragraphs that don’t have any styling. Our test coverage
is pretty good, so this should check almost all pages, and prevent
regressions.

I’ve done this in such a way that it can be extended for other elements
(e.g. links) in the future.
This commit is contained in:
Chris Hill-Scott
2020-05-29 17:11:01 +01:00
parent 82ec03e263
commit 4df99bd27f
134 changed files with 517 additions and 497 deletions
@@ -9,7 +9,7 @@
<h1 class="heading-large">Edit and format messages</h1>
<p>This page explains how to:</p>
<p class="govuk-body">This page explains how to:</p>
<ul class="list list-bullet">
<li><a class="govuk-link govuk-link--no-visited-state" href="#formatting">format your content</a></li>
<li><a class="govuk-link govuk-link--no-visited-state" href="#links">add links</a></li>
@@ -19,14 +19,14 @@
<h2 class="heading-medium" id="formatting">Format your content</h2>
<p>You can see a list of formatting instructions on the edit template page:</p>
<p class="govuk-body">You can see a list of formatting instructions on the edit template page:</p>
<ol class="list list-number">
<li>Go to the {{ service_link(current_service, 'main.choose_template', 'templates') }} page.</li>
<li>Add a new template or choose an existing template and select <b class="govuk-!-font-weight-bold">Edit</b>.</li>
</ol>
<p>Email templates can include:</p>
<p class="govuk-body">Email templates can include:</p>
<ul class="list list-bullet">
<li>headings</li>
<li>bullets</li>
@@ -34,17 +34,17 @@
<li>horizontal rules</li>
</ul>
<p>Letter templates can include headings and bullets.</p>
<p class="govuk-body">Letter templates can include headings and bullets.</p>
<p>Notify does not allow bold, italics, subheadings, underlined text or different fonts. This is because they can make it harder for users to read what youve written.</p>
<p class="govuk-body">Notify does not allow bold, italics, subheadings, underlined text or different fonts. This is because they can make it harder for users to read what youve written.</p>
<h2 class="heading-medium" id="links">Add links</h2>
<p>When composing an email or text message, write URLs in full and Notify will convert them into links for you.</p>
<p class="govuk-body">When composing an email or text message, write URLs in full and Notify will convert them into links for you.</p>
<p>You cannot convert text into a link. Research shows that people like to check a URL looks genuine before clicking the link in an email. This is hard to do if the URL is hidden behind clickable link text.</p>
<p class="govuk-body">You cannot convert text into a link. Research shows that people like to check a URL looks genuine before clicking the link in an email. This is hard to do if the URL is hidden behind clickable link text.</p>
<p>We do not recommend using a third-party link shortening service because:</p>
<p class="govuk-body">We do not recommend using a third-party link shortening service because:</p>
<ul class="list list-bullet">
<li>your users cannot see where the link will take them</li>
@@ -54,11 +54,11 @@
<h2 class="heading-medium" id="personalised-content">Personalise your content</h2>
<p>To personalise the content of your messages, add a placeholder to the template.</p>
<p class="govuk-body">To personalise the content of your messages, add a placeholder to the template.</p>
<p>Placeholders are filled in with details, like a name or reference number, each time you send a message.</p>
<p class="govuk-body">Placeholders are filled in with details, like a name or reference number, each time you send a message.</p>
<p>To add a placeholder to the template:</p>
<p class="govuk-body">To add a placeholder to the template:</p>
<ol class="list list-number">
<li>Go to the {{ service_link(current_service, 'main.choose_template', 'templates') }} page.</li>
@@ -67,18 +67,18 @@
<li>Select <b class="govuk-!-font-weight-bold">Save</b>.</li>
</ol>
<p>When you send a message you can either:</p>
<p class="govuk-body">When you send a message you can either:</p>
<ul class="list list-bullet">
<li>manually fill in the placeholders yourself</li>
<li>upload a list of personal details and let Notify do it for you</li>
</ul>
<p>If you upload a list, the column names need to match the placeholders in your template.</p>
<p class="govuk-body">If you upload a list, the column names need to match the placeholders in your template.</p>
<h2 class="heading-medium" id="optional-content">Add optional content</h2>
<p>To add optional content to your emails and text messages:</p>
<p class="govuk-body">To add optional content to your emails and text messages:</p>
<ol class="list list-number">
<li>Go to the {{ service_link(current_service, 'main.choose_template', 'templates') }} page.</li>
@@ -87,15 +87,15 @@
<li>Select <b class="govuk-!-font-weight-bold">Save</b>.</li>
</ol>
<p>For each person you send this message to, specify yes or no to show or hide this content. You can either:</p>
<p class="govuk-body">For each person you send this message to, specify yes or no to show or hide this content. You can either:</p>
<ul class="list list-bullet">
<li>do this yourself</li>
<li>upload a list of personal details and let Notify do it for you</li>
</ul>
<p>If you upload a list, the column names need to match the optional content in your template.</p>
<p class="govuk-body">If you upload a list, the column names need to match the optional content in your template.</p>
<p>You cannot add optional content to a letter.</p>
<p class="govuk-body">You cannot add optional content to a letter.</p>
{% endblock %}