Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion profiles/aom.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const modules = [
import("../src/aom/abstract.js"),
import("../src/core/data-transform.js"),
import("../src/core/data-abbr.js"),
import("../src/core/algorithms.js"),
import("../src/core/inlines.js"),
import("../src/aom/conformance.js"),
import("../src/core/dfn.js"),
Expand All @@ -40,7 +41,6 @@ const modules = [
import("../src/core/list-sorter.js"),
import("../src/core/highlight-vars.js"),
import("../src/core/data-type.js"),
import("../src/core/algorithms.js"),
import("../src/core/anchor-expander.js"),
import("../src/core/dfn-panel.js"),
import("../src/core/custom-elements/index.js"),
Expand Down
2 changes: 1 addition & 1 deletion profiles/dini.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const modules = [
import("../src/dini/abstract.js"),
import("../src/core/data-transform.js"),
import("../src/core/data-abbr.js"),
import("../src/core/algorithms.js"),
import("../src/core/inlines.js"),
import("../src/dini/conformance.js"),
import("../src/core/dfn.js"),
Expand All @@ -40,7 +41,6 @@ const modules = [
import("../src/core/list-sorter.js"),
import("../src/core/highlight-vars.js"),
import("../src/core/data-type.js"),
import("../src/core/algorithms.js"),
import("../src/core/anchor-expander.js"),
import("../src/core/dfn-panel.js"),
import("../src/core/custom-elements/index.js"),
Expand Down
2 changes: 1 addition & 1 deletion profiles/geonovum.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const modules = [
import("../src/core/markdown.js"),
import("../src/core/reindent.js"),
import("../src/core/data-transform.js"),
import("../src/core/algorithms.js"),
import("../src/core/inlines.js"),
import("../src/core/dfn.js"),
import("../src/core/pluralize.js"),
Expand All @@ -39,7 +40,6 @@ const modules = [
import("../src/core/data-tests.js"),
import("../src/core/list-sorter.js"),
import("../src/core/highlight-vars.js"),
import("../src/core/algorithms.js"),
import("../src/core/anchor-expander.js"),
import("../src/core/dfn-panel.js"),
import("../src/core/dfn-contract.js"),
Expand Down
2 changes: 1 addition & 1 deletion profiles/w3c.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const modules = [
import("../src/w3c/abstract.js"),
import("../src/core/data-transform.js"),
import("../src/core/data-abbr.js"),
import("../src/core/algorithms.js"),
import("../src/core/inlines.js"),
import("../src/w3c/conformance.js"),
import("../src/core/dfn.js"),
Expand Down Expand Up @@ -55,7 +56,6 @@ const modules = [
import("../src/core/list-sorter.js"),
import("../src/core/highlight-vars.js"),
import("../src/core/data-type.js"),
import("../src/core/algorithms.js"),
import("../src/core/anchor-expander.js"),
import("../src/core/dfn-panel.js"),
import("../src/core/custom-elements/index.js"),
Expand Down
15 changes: 9 additions & 6 deletions src/core/algorithms.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
Currently used only for adding 'assert' class to algorithm lists
*/
import css from "../styles/algorithms.css.js";
import { html } from "./import-maps.js";

export const name = "core/algorithms";

Expand All @@ -20,17 +19,21 @@ export function run() {
for (const li of elements) {
li.classList.add("assert");

// Link "Assert" to https://infra.spec.whatwg.org/#assert
// Link "Assert" to infra spec using [=Assert=] syntax
// Add data-cite="infra" to the li if not already citing infra in the tree
const textNode = li.firstChild;
if (
textNode instanceof Text &&
textNode.textContent.startsWith("Assert: ")
) {
textNode.textContent = textNode.textContent.replace("Assert: ", "");
li.prepend(
html`<a href="https://infra.spec.whatwg.org/#assert">Assert</a>`,
": "
textNode.textContent = textNode.textContent.replace(
"Assert: ",
"[=Assert=]: "
);
// Add data-cite if infra is not already cited in the ancestor tree
if (!li.closest("[data-cite~='INFRA' i], [data-cite~='infra' i]")) {
li.dataset.cite = "INFRA";
}
}
}

Expand Down