From 4f2f4e8af5f2f67a757767f03b024f3c11138783 Mon Sep 17 00:00:00 2001 From: Onkar Ruikar <87750369+OnkarRuikar@users.noreply.github.com> Date: Thu, 15 Sep 2022 17:20:22 +0530 Subject: [PATCH] Tag `example-bad` blocks with html-nolint (#20630) * Tag `example-bad` blocks with html-nolint - Updating example-bad code blocks with the new tag. Refer: https://github.com/mdn/yari/pull/7017 * Update files/en-us/learn/accessibility/html/index.md * Update files/en-us/learn/accessibility/html/index.md * Removed suggested no nolints Co-authored-by: Jean-Yves Perrier * remove a trailing space * Update files/en-us/learn/accessibility/html/index.md * Update files/en-us/learn/accessibility/html/index.md Co-authored-by: Jean-Yves Perrier --- files/en-us/learn/accessibility/html/index.md | 3 ++- .../getting_started_with_the_web/html_basics/index.md | 2 +- .../html/introduction_to_html/getting_started/index.md | 8 ++++---- .../cross_browser_testing/accessibility/index.md | 3 ++- .../writing_style_guide/code_style_guide/html/index.md | 8 ++++---- files/en-us/web/html/element/a/index.md | 10 +++++++--- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/files/en-us/learn/accessibility/html/index.md b/files/en-us/learn/accessibility/html/index.md index 4591c85c64e17fb..d9747af0a31ffb5 100644 --- a/files/en-us/learn/accessibility/html/index.md +++ b/files/en-us/learn/accessibility/html/index.md @@ -127,7 +127,8 @@ We've prepared a version with longer text for you to try out with a screen reade People sometimes write headings, paragraphs, etc. using line breaks and adding HTML elements purely for styling, something like the following: ```html example-bad -My heading

+My heading +

This is the first section of my document.

I'll add another paragraph here too. diff --git a/files/en-us/learn/getting_started_with_the_web/html_basics/index.md b/files/en-us/learn/getting_started_with_the_web/html_basics/index.md index 5a0295bca34bd39..15dc5ae7f479242 100644 --- a/files/en-us/learn/getting_started_with_the_web/html_basics/index.md +++ b/files/en-us/learn/getting_started_with_the_web/html_basics/index.md @@ -66,7 +66,7 @@ You can put elements inside other elements too — this is called **nesting**. I You do however need to make sure that your elements are properly nested. In the example above, we opened the {{htmlelement("p")}} element first, then the {{htmlelement("strong")}} element; therefore, we have to close the {{htmlelement("strong")}} element first, then the {{htmlelement("p")}} element. The following is incorrect: -```html example-bad +```html-nolint example-bad

My cat is very grumpy.

``` diff --git a/files/en-us/learn/html/introduction_to_html/getting_started/index.md b/files/en-us/learn/html/introduction_to_html/getting_started/index.md index eb0aa8e124297e7..00ed371ee7c7806 100644 --- a/files/en-us/learn/html/introduction_to_html/getting_started/index.md +++ b/files/en-us/learn/html/introduction_to_html/getting_started/index.md @@ -213,7 +213,7 @@ There is a right and wrong way to do nesting. In the example above, we opened th The following is an example of the _wrong_ way to do nesting: -```html example-bad +```html-nolint example-bad

My cat is very grumpy.

``` @@ -454,7 +454,7 @@ If you look at code for a lot of other sites, you might come across a number of However, as soon as we add the `title` attribute in this way, there are problems: -```html example-bad +```html-nolint example-bad favorite website ``` @@ -476,7 +476,7 @@ In this article you will also notice that the attributes are wrapped in double q Make sure you don't mix single quotes and double quotes. This example (below) shows a kind of mixing quotes that will go wrong: -```html example-bad +```html-nolint example-bad My heading

+My heading +

This is the first section of my document.

I'll add another paragraph here too. diff --git a/files/en-us/mdn/writing_guidelines/writing_style_guide/code_style_guide/html/index.md b/files/en-us/mdn/writing_guidelines/writing_style_guide/code_style_guide/html/index.md index ac09dfb1a892a87..edb442cc75831fd 100644 --- a/files/en-us/mdn/writing_guidelines/writing_style_guide/code_style_guide/html/index.md +++ b/files/en-us/mdn/writing_guidelines/writing_style_guide/code_style_guide/html/index.md @@ -73,7 +73,7 @@ You should put all attribute values in double quotes. It is tempting to omit quo …than this: -```html example-bad +```html-nolint example-bad A ``` @@ -89,7 +89,7 @@ required This is perfectly understandable and works fine; the longer version with the value is supported but not necessary: -```html example-bad +```html-nolint example-bad required="required" ``` @@ -101,7 +101,7 @@ Use lowercase for all element names and attribute names/values because it looks

This looks nice and neat

``` -```html example-bad +```html-nolint example-bad

Why is my markup shouting?

``` @@ -125,7 +125,7 @@ Use double quotes for HTML, not single quotes, like so:

Yes

``` -```html example-bad +```html-nolint example-bad

Nope

``` diff --git a/files/en-us/web/html/element/a/index.md b/files/en-us/web/html/element/a/index.md index f15b58658dfae39..9ecdb7727ab6b63 100644 --- a/files/en-us/web/html/element/a/index.md +++ b/files/en-us/web/html/element/a/index.md @@ -1,5 +1,5 @@ --- -title: '
: The Anchor element' +title: ": The Anchor element" slug: Web/HTML/Element/a tags: - Content @@ -370,7 +370,9 @@ Using `target="_blank"` without [`rel="noreferrer"`](/en-US/docs/Web/HTML/Link_t A sadly common mistake is to only link the words "click here" or "here": ```html example-bad -

Learn more about our products here.

+

+ Learn more about our products here. +

``` #### Strong link text @@ -378,7 +380,9 @@ A sadly common mistake is to only link the words "click here" or "here": Luckily, this is an easy fix, and it's actually shorter than the inaccessible version! ```html example-good -

Learn more about our products.

+

+ Learn more about our products. +

``` Assistive software has shortcuts to list all links on a page. However, strong link text benefits all users — the "list all links" shortcut emulates how sighted users quickly scan pages.