Elchi3 / mdn-doc-tests

:no_entry_sign: UNMAINTAINED :no_entry_sign: This used to check MDN docs against some tests and cleanup tasks while editing, but add-on SDK based add-ons are obsolete. Use https://github.com/mdn/doc-linter-webextension and https://github.com/mdn/doc-linter-rules instead.
Mozilla Public License 2.0
10 stars 8 forks source link

Enable errors to be suppressed for some intentional cases (e.g., some cases of inline style attributes) #228

Open sideshowbarker opened 7 years ago

sideshowbarker commented 7 years ago

Use of inline style attributes is an error I want to be alerted about, so it is extremely useful that the documentation tester catches it so I can fix pages that contain it.

However, some (very few) pages intentionally use the style attribute inline for particular reasons. For example, the https://developer.mozilla.org/en-US/docs/Web/HTML/Element/s page uses the style attribute to illustrate how the native styling of the s element compares to styling with CSS:

<p><s>Today's Special: Salmon</s> SOLD OUT<br />
 <s style="text-decoration:line-through">Today's Special: Salmon</s> SOLD OUT</p>

In those cases, it would be useful to have a way to suppress the Style attributes error.

One way to do that might be win a macro; for example:

<p><s>Today's Special: Salmon</s> SOLD OUT<br />
{{DocTesterOff}}
 <s style="text-decoration:line-through">Today's Special: Salmon</s> SOLD OUT</p>
{{DocTesterOn}}

So in the example above, the {{DocTesterOff}} macro would cause the Documentation Tester to stop checking the document until it sees a {{DocTesterOn}} macro.

But that’s just an idea. I’m not wedded to any particular solution. But the problem I want to solve is that I want to be able to ensure that I can unintended errors and they don’t get obscured by errors about cases that are intentional.