question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

All sentences should be inside <p> (or the relevant semantic elements)

See original GitHub issue

I’m going to add a few points that came out of a recent developer review, before three of our services are sent for an external accessibility audit.

Inset text and Panel components

We’re currently using the govukInsetText() and govukPanel() macros and we’ve been flagged during a developer review for putting text inside <div> tags.

All three services were caught out by this.

The non-semantic HTML is the recommended usage on the GOV.UK Design System examples shown here:

https://design-system.service.gov.uk/components/inset-text/ https://design-system.service.gov.uk/components/panel/

You can see in these screenshots:

Inset text Panel

Since other service teams may copy from the examples and make the same mistakes as us, I’d prefer it if the examples included semantic HTML by default! 😊

Suggested change:

Before

{{ params.html | safe if params.html else params.text }}

After

{% if params.html %}{{ params.html | safe }}{% else %}<p>{{ params.text }}</p>{% endif %}

But other macros might be affected too.

It’s been raised before in https://github.com/alphagov/govuk-design-system/issues/822

Thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
adamliptrot-occommented, Feb 6, 2020

WHATWG deem the<p> element as only one way of markup up a paragraph. Semantically it seems not to have any impact. There could be styling implications of course. https://html.spec.whatwg.org/multipage/dom.html#paragraph

0reactions
NickColleycommented, Feb 7, 2020

Thanks @adamliptrot-oc, that’s good context, I’ve had a chat about this with some people on the team…

We’re going to close this for now as we want to avoid breaking changes unless it’s necessary, but we’re happy to revisit this again if we become aware of any real-world issues caused by the lack of <p> tags.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML Semantic Elements - W3Schools
Semantic elements = elements with a meaning. What are Semantic Elements? A semantic element clearly describes its meaning to both the browser and...
Read more >
<p>: The Paragraph element - HTML - MDN Web Docs - Mozilla
The HTML element represents a paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks ...
Read more >
Semantic HTML: What It Is and How to Use It Correctly
Semantic HTML conveys real meaning through HTML tags. Here's what you need to know and how to use it.
Read more >
Semantic HTML5 Elements Explained - freeCodeCamp
Semantic HTML elements are those that clearly describe their meaning in a human- and machine-readable way. Elements such as , and are all...
Read more >
Accessibility | HTML Best Practices | Content - Hawkes Learning
Learn about Hawkes' best practices for producing web content. This page provides our best practices for HTML content.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found