Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow use of Markdown in description and notes #21495

Merged
merged 30 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
91a53cc
Allow use of Markdown in description and notes
queengooborg Dec 6, 2023
e7b428a
Update description linter
queengooborg Dec 6, 2023
c07b311
Fix note test
queengooborg Dec 6, 2023
f3aeb6f
Merge branch 'main' into markdown-notes
queengooborg Dec 10, 2023
a76ad86
Merge branch 'main' into markdown-notes
queengooborg Dec 11, 2023
d7f9ad2
Merge branch 'main' into markdown-notes
queengooborg Dec 14, 2023
c57648c
Merge branch 'main' into markdown-notes
queengooborg Dec 15, 2023
fb8dc3d
Merge branch 'main' into markdown-notes
queengooborg Dec 18, 2023
a09809d
Merge branch 'main' into markdown-notes
queengooborg Dec 19, 2023
f8fa99a
Merge branch 'main' into markdown-notes
queengooborg Mar 28, 2024
7360b37
Merge branch 'main' into markdown-notes
queengooborg Jun 25, 2024
9727e58
Merge branch 'main' into markdown-notes
queengooborg Jul 8, 2024
5bbaaa1
Revert changes to description linter for now
queengooborg Jul 16, 2024
2a944ee
Merge branch 'main' into markdown-notes
queengooborg Jul 22, 2024
f535e46
Merge branch 'main' into markdown-notes
queengooborg Aug 27, 2024
f3bb756
Fix package-lock.json
queengooborg Aug 27, 2024
426dc57
Merge branch 'main' into markdown-notes
queengooborg Aug 28, 2024
b043b9a
Merge branch 'main' into markdown-notes
caugner Oct 8, 2024
e06bfaf
chore(deps-dev): bump marked from 10.0.0 to 10.2.0
caugner Oct 8, 2024
01ea2cc
Merge branch 'main' into markdown-notes
caugner Oct 8, 2024
3121d79
Fix description
queengooborg Oct 12, 2024
39825a3
Merge branch 'main' into markdown-notes
queengooborg Nov 2, 2024
3307fd9
Ensure <, >, etc. is preserved
queengooborg Nov 2, 2024
452e84d
Convert `<code>` tags to backticks before performing Markdown parsing
queengooborg Nov 2, 2024
58de17a
Fix problematic notes
queengooborg Nov 2, 2024
17ac0c9
Add missing code tags
queengooborg Nov 2, 2024
cc1187e
Fix description for RegExp.leftContext
queengooborg Nov 2, 2024
e8a393c
Merge branch 'main' into markdown-notes
queengooborg Nov 15, 2024
cfe1b04
Fix Chromium bug numbers
queengooborg Nov 15, 2024
8c01cfd
fix(markdown): use double backtick to use backtick in code
caugner Nov 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/HTMLAnchorElement.json
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@
},
"firefox": {
"version_added": "1",
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of <code>https://z.com/x?a=true&amp;b=false</code>, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of `https://z.com/x?a=true&amp;b=false`, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
},
"firefox_android": "mirror",
"ie": {
Expand Down Expand Up @@ -1057,7 +1057,7 @@
},
"firefox": {
"version_added": "1",
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of <code>https://z.com/x?a=true&amp;b=false</code>, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of `https://z.com/x?a=true&amp;b=false`, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
},
"firefox_android": "mirror",
"ie": {
Expand Down
4 changes: 2 additions & 2 deletions api/HTMLAreaElement.json
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@
},
"firefox": {
"version_added": "1",
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of <code>https://z.com/x?a=true&amp;b=false</code>, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of `https://z.com/x?a=true&amp;b=false`, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
},
"firefox_android": "mirror",
"ie": {
Expand Down Expand Up @@ -866,7 +866,7 @@
},
"firefox": {
"version_added": "1",
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of <code>https://z.com/x?a=true&amp;b=false</code>, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
"notes": "Before Firefox 53, the <code>pathname</code> and <code>search</code> <code>HTMLHyperlinkElementUtils</code> properties returned the wrong parts of the URL. For example, for a URL of `https://z.com/x?a=true&amp;b=false`, <code>pathname</code> would return <code>'/x?a=true&amp;b=false'</code> and <code>search</code> would return '', rather than <code>'/x'</code> and <code>'?a=true&amp;b=false'</code> respectively. This has now been fixed."
},
"firefox_android": "mirror",
"ie": {
Expand Down
2 changes: 1 addition & 1 deletion api/HTMLInputElement.json
Original file line number Diff line number Diff line change
Expand Up @@ -1782,7 +1782,7 @@
"support": {
"chrome": {
"version_added": false,
"notes": "A <code>selectionchange</code> event is fired on <code>Document</code>, see <a href='https://developer.mozilla.org/docs/Web/API/Document/selectionchange_event'><code>Document</code>'s <code>selectionchange</code> event</a>. See <a href='https://crbug.com/40840956'>bug 40840956</a> for firing the event on <code>&lt;input&gt;</code> elements."
"notes": "A <code>selectionchange</code> event is fired on <code>Document</code>, see [`Document`'s `selectionchange` event](https://developer.mozilla.org/docs/Web/API/Document/selectionchange_event). See <a href='https://crbug.com/1327098'>bug 1327098</a> for firing the event on <code>&lt;input&gt;</code> elements."
queengooborg marked this conversation as resolved.
Show resolved Hide resolved
},
"chrome_android": "mirror",
"edge": "mirror",
Expand Down
2 changes: 1 addition & 1 deletion api/HTMLTextAreaElement.json
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@
"support": {
"chrome": {
"version_added": false,
"notes": "A <code>selectionchange</code> event is fired on <code>Document</code>, see <a href='https://developer.mozilla.org/docs/Web/API/Document/selectionchange_event'><code>Document</code>'s <code>selectionchange</code> event</a>. See <a href='https://crbug.com/40840956'>bug 40840956</a> for firing the event on <code>&lt;textarea&gt;</code> elements."
"notes": "A <code>selectionchange</code> event is fired on <code>Document</code>, see [`Document`'s `selectionchange` event](https://developer.mozilla.org/docs/Web/API/Document/selectionchange_event). See <a href='https://crbug.com/1327098'>bug 1327098</a> for firing the event on <code>&lt;textarea&gt;</code> elements."
queengooborg marked this conversation as resolved.
Show resolved Hide resolved
},
"chrome_android": "mirror",
"edge": "mirror",
Expand Down
2 changes: 1 addition & 1 deletion css/properties/flex.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"notes": [
"Since Firefox 28, multi-line flexbox is supported.",
"Before Firefox 32, Firefox wasn't able to animate values starting or stopping at <code>0</code>.",
"Until Firefox 61, flex items that are sized according to their content are sized using <a href='https://drafts.csswg.org/css-sizing-3/#column-sizing'><code>fit-content</code>, not <code>max-content</code></a>."
"Until Firefox 61, flex items that are sized according to their content are sized using <a href='https://drafts.csswg.org/css-sizing-3/#column-sizing'>`fit-content`, not `max-content`</a>."
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions css/properties/hyphens.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
},
"language_bosnian": {
"__compat": {
"description": "Hyphenation dictionary for Bosnian, Serbian, and Serbo-Croatian (sh, sh-*, sr, sr-*, bs, bs-*)",
"description": "Hyphenation dictionary for Bosnian, Serbian, and Serbo-Croatian (sh, sh-\\*, sr, sr-\\*, bs, bs-\\*)",
"tags": [
"web-features:hyphens"
],
Expand Down Expand Up @@ -1768,7 +1768,7 @@
},
"language_norwegian_nn": {
"__compat": {
"description": "Hyphenation dictionary for Norwegian (Nynorsk) (nn, nn-*)",
"description": "Hyphenation dictionary for Norwegian (Nynorsk) (nn, nn-\\*)",
"tags": [
"web-features:hyphens"
],
Expand Down Expand Up @@ -1807,7 +1807,7 @@
},
"language_norwegian_no": {
"__compat": {
"description": "Hyphenation dictionary for Norwegian (Bokmål) (no, no-*, nb, nb-*)",
"description": "Hyphenation dictionary for Norwegian (Bokmål) (no, no-\\*, nb, nb-\\*)",
"tags": [
"web-features:hyphens"
],
Expand Down
2 changes: 1 addition & 1 deletion javascript/builtins/RegExp.json
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@
},
"leftContext": {
"__compat": {
"description": "<code>RegExp.leftContext</code> (<code>$`</code>)",
"description": "`RegExp.leftContext` (`$\\``)",
caugner marked this conversation as resolved.
Show resolved Hide resolved
"mdn_url": "https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/RegExp/leftContext",
"spec_url": "https://github.com/tc39/proposal-regexp-legacy-features/#additional-properties-of-the-regexp-constructor",
"support": {
Expand Down
2 changes: 1 addition & 1 deletion lint/linter/test-descriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export default {

for (const error of errors) {
if (typeof error === 'string') {
logger.error(chalk`Description → ${error}`);
logger.error(chalk`{red ${error}}`);
} else {
logger.error(
chalk`{red Incorrect ${error.ruleName} description for {bold ${error.path}}
Expand Down
6 changes: 4 additions & 2 deletions lint/linter/test-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import chalk from 'chalk-template';
import HTMLParser from '@desertnet/html-parser';
import { marked } from 'marked';

import { Linter, Logger, LinterData, VALID_ELEMENTS } from '../utils.js';
import {
Expand Down Expand Up @@ -68,11 +69,12 @@ const testNode = (node): string[] => {
*/
export const validateHTML = (string: string): string[] => {
const errors: string[] = [];
const htmlErrors = HTMLParser.validate(string);
const html = marked.parseInline(string);
const htmlErrors = HTMLParser.validate(html);

if (htmlErrors.length === 0) {
// If HTML is valid, ensure we're only using valid elements
errors.push(...testNode(parser.parse(string)));
errors.push(...testNode(parser.parse(html)));
} else {
errors.push(
chalk`Invalid HTML: ${htmlErrors.map((x) => x._message).join(', ')}`,
Expand Down
Loading
Loading