Run lint and prettier
CI Pipeline / test (20) (pull_request) Failing after 8m5s
CI Pipeline / test (18) (pull_request) Failing after 8m36s
CI Pipeline / e2e (chromium) (pull_request) Successful in 2m32s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m40s
CI Pipeline / e2e (firefox) (pull_request) Successful in 5m43s
CI Pipeline / performance (pull_request) Failing after 3m18s
CI Pipeline / visual-regression (pull_request) Failing after 3m20s
CI Pipeline / lint (pull_request) Successful in 1m7s
CI Pipeline / storybook (pull_request) Successful in 1m32s
CI Pipeline / build (pull_request) Successful in 1m22s
CI Pipeline / test (20) (pull_request) Failing after 8m5s
CI Pipeline / test (18) (pull_request) Failing after 8m36s
CI Pipeline / e2e (chromium) (pull_request) Successful in 2m32s
CI Pipeline / e2e (webkit) (pull_request) Successful in 3m40s
CI Pipeline / e2e (firefox) (pull_request) Successful in 5m43s
CI Pipeline / performance (pull_request) Failing after 3m18s
CI Pipeline / visual-regression (pull_request) Failing after 3m20s
CI Pipeline / lint (pull_request) Successful in 1m7s
CI Pipeline / storybook (pull_request) Successful in 1m32s
CI Pipeline / build (pull_request) Successful in 1m22s
This commit is contained in:
+13
-13
@@ -159,34 +159,34 @@ function markdownToHtml(markdown) {
|
||||
// Headers with IDs
|
||||
.replace(
|
||||
/^###### (.*$)/gim,
|
||||
(m, t) => `<h6 id="${generateHeadingId(t)}">${t}</h6>`
|
||||
(m, t) => `<h6 id="${generateHeadingId(t)}">${t}</h6>`,
|
||||
)
|
||||
.replace(
|
||||
/^##### (.*$)/gim,
|
||||
(m, t) => `<h5 id="${generateHeadingId(t)}">${t}</h5>`
|
||||
(m, t) => `<h5 id="${generateHeadingId(t)}">${t}</h5>`,
|
||||
)
|
||||
.replace(
|
||||
/^#### (.*$)/gim,
|
||||
(m, t) => `<h4 id="${generateHeadingId(t)}">${t}</h4>`
|
||||
(m, t) => `<h4 id="${generateHeadingId(t)}">${t}</h4>`,
|
||||
)
|
||||
.replace(
|
||||
/^### (.*$)/gim,
|
||||
(m, t) => `<h3 id="${generateHeadingId(t)}">${t}</h3>`
|
||||
(m, t) => `<h3 id="${generateHeadingId(t)}">${t}</h3>`,
|
||||
)
|
||||
.replace(
|
||||
/^## (.*$)/gim,
|
||||
(m, t) => `<h2 id="${generateHeadingId(t)}">${t}</h2>`
|
||||
(m, t) => `<h2 id="${generateHeadingId(t)}">${t}</h2>`,
|
||||
)
|
||||
.replace(
|
||||
/^# (.*$)/gim,
|
||||
(m, t) => `<h1 id="${generateHeadingId(t)}">${t}</h1>`
|
||||
(m, t) => `<h1 id="${generateHeadingId(t)}">${t}</h1>`,
|
||||
)
|
||||
|
||||
// Code fences (block) and inline code
|
||||
.replace(
|
||||
/```(\w+)?\n([\s\S]*?)\n```/g,
|
||||
(m, lang = "", code) =>
|
||||
`<pre><code class="language-${lang}">${code}</code></pre>`
|
||||
`<pre><code class="language-${lang}">${code}</code></pre>`,
|
||||
)
|
||||
.replace(/`([^`]+)`/g, "<code>$1</code>")
|
||||
|
||||
@@ -198,12 +198,12 @@ function markdownToHtml(markdown) {
|
||||
.replace(
|
||||
/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g,
|
||||
(m, alt, src, title = "") =>
|
||||
`<img alt="${alt}" src="${src}"${title ? ` title="${title}"` : ""}>`
|
||||
`<img alt="${alt}" src="${src}"${title ? ` title="${title}"` : ""}>`,
|
||||
)
|
||||
.replace(
|
||||
/\[([^\]]+)\]\(([^)\s]+)(?:\s+"([^"]+)")?\)/g,
|
||||
(m, text, href, title = "") =>
|
||||
`<a href="${href}"${title ? ` title="${title}"` : ""}>${text}</a>`
|
||||
`<a href="${href}"${title ? ` title="${title}"` : ""}>${text}</a>`,
|
||||
)
|
||||
|
||||
// Blockquotes
|
||||
@@ -211,7 +211,7 @@ function markdownToHtml(markdown) {
|
||||
const inner = m.replace(/^>\s?/gm, "");
|
||||
return `<blockquote><p>${inner.replace(
|
||||
/\n{2,}/g,
|
||||
"</p><p>"
|
||||
"</p><p>",
|
||||
)}</p></blockquote>`;
|
||||
})
|
||||
|
||||
@@ -247,7 +247,7 @@ function markdownToHtml(markdown) {
|
||||
// (Also skip our GAP_TOKEN so we can turn it into gap paragraphs later.)
|
||||
.replace(
|
||||
/^(?!\s*<(h[1-6]|ul|ol|li|blockquote|hr|pre|code|table|img)\b)(?!\s*<\/)(?!\s*<GAP\/>)(.+)$/gim,
|
||||
"<p>$2</p>"
|
||||
"<p>$2</p>",
|
||||
)
|
||||
|
||||
// Clean up truly empty paragraphs but keep gap paragraphs
|
||||
@@ -258,8 +258,8 @@ function markdownToHtml(markdown) {
|
||||
/<GAP:(\d+)\/>/g,
|
||||
(m, n) =>
|
||||
`<div class="md-gap" style="--gap:${Number(
|
||||
n
|
||||
)}" aria-hidden="true"></div>`
|
||||
n,
|
||||
)}" aria-hidden="true"></div>`,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user