From 9581d8151ea333cada78c698dc4b1365c98ca90c Mon Sep 17 00:00:00 2001 From: Will Bamberg Date: Thu, 1 Dec 2022 20:05:00 -0800 Subject: [PATCH 1/4] Remove tags from cssxref --- kumascript/macros/cssxref.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kumascript/macros/cssxref.ejs b/kumascript/macros/cssxref.ejs index 9e3527d9a206..7fd5fe445e29 100644 --- a/kumascript/macros/cssxref.ejs +++ b/kumascript/macros/cssxref.ejs @@ -60,11 +60,11 @@ const thisPage = (!$1 || !$2) ? wiki.getPage(urlWithoutAnchor) : null; if (!$1) { // Append parameter brackets to CSS functions - if (page.hasTag(thisPage, "CSS Function") && !str.endsWith("()")) { + if ((thisPage.pageType === "css-function") && !str.endsWith("()")) { str += "()"; } // Enclose CSS data types in arrow brackets - if (page.hasTag(thisPage, "CSS Data Type") && !/^<.+>$/.test(str)) { + if ((thisPage.pageType === "css-type") && !/^<.+>$/.test(str)) { str = "<" + str + ">"; } } From cce880c74539e93bf98f531fd636e639baa4874f Mon Sep 17 00:00:00 2001 From: Will Bamberg Date: Thu, 1 Dec 2022 20:18:01 -0800 Subject: [PATCH 2/4] Update tests --- kumascript/tests/macros/cssxref.test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kumascript/tests/macros/cssxref.test.ts b/kumascript/tests/macros/cssxref.test.ts index 6a5d768234eb..9eb3206fa8ea 100644 --- a/kumascript/tests/macros/cssxref.test.ts +++ b/kumascript/tests/macros/cssxref.test.ts @@ -30,7 +30,7 @@ const MOCK_PAGES = { url: [CSS_BASE_URL, "display"].join("/"), summary: 'The display CSS property specifies the type of rendering box used for an element.', - tags: ["CSS", "CSS Property", "CSS Display"], + pageType: "css-property", }, }, attr: { @@ -39,7 +39,7 @@ const MOCK_PAGES = { url: [CSS_BASE_URL, "attr()"].join("/"), summary: 'The attr() CSS function is used to retrieve the value of an attribute of the selected element and use it in the style sheet.', - tags: ["CSS", "Reference", "Web", "CSS Function", "Layout"], + pageType: "css-function", }, }, length: { @@ -48,7 +48,7 @@ const MOCK_PAGES = { url: [CSS_BASE_URL, "length"].join("/"), summary: 'The <length> CSS data type represents a distance value.', - tags: ["CSS", "Reference", "Web", "Layout", "CSS Data Type", "length"], + pageType: "css-type", }, }, color_value: { @@ -57,7 +57,7 @@ const MOCK_PAGES = { url: [CSS_BASE_URL, "color_value"].join("/"), summary: 'The <color> CSS data type represents a color in the sRGB color space.', - tags: ["CSS", "Reference", "Web", "CSS Data Type", "Layout"], + pageType: "css-type", }, }, flex_value: { @@ -66,7 +66,7 @@ const MOCK_PAGES = { url: [CSS_BASE_URL, "flex_value"].join("/"), summary: 'The <flex> CSS data type denotes a flexible length within a grid container.', - tags: ["CSS", "Reference", "Web", "CSS Data Type", "Layout"], + pageType: "css-type", }, }, position_value: { @@ -75,7 +75,7 @@ const MOCK_PAGES = { url: [CSS_BASE_URL, "position_value"].join("/"), summary: 'The <position> CSS data type denotes a two-dimensional coordinate used to set a location relative to an element box.', - tags: ["CSS", "Reference", "Web", "CSS Data Type", "Layout"], + pageType: "css-type", }, }, }; From 954d0cf8b71a0f44e8565097092e040d0ed69cde Mon Sep 17 00:00:00 2001 From: Will Bamberg Date: Thu, 1 Dec 2022 21:06:10 -0800 Subject: [PATCH 3/4] Fix more tests, possibly --- kumascript/tests/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kumascript/tests/index.test.ts b/kumascript/tests/index.test.ts index 83753650c8f4..98ae43f89d36 100644 --- a/kumascript/tests/index.test.ts +++ b/kumascript/tests/index.test.ts @@ -83,7 +83,7 @@ describe("testing the main render() function", () => { title: "", locale: "en-US", slug: "Web/Number", - tags: ["Web", "CSS", "CSS Data Type", "Layout", "Reference"], + "page-type": "css-type", }, rawBody: "

This is the number test page.

", isMarkdown: false, From d87a425dfa6530ec70093ef23aa4b2a439c74172 Mon Sep 17 00:00:00 2001 From: Will Bamberg Date: Thu, 1 Dec 2022 21:15:48 -0800 Subject: [PATCH 4/4] Yet another failing test --- testing/content/files/en-us/web/css/number/index.html | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/testing/content/files/en-us/web/css/number/index.html b/testing/content/files/en-us/web/css/number/index.html index c230afefa1ca..cd0679019a29 100644 --- a/testing/content/files/en-us/web/css/number/index.html +++ b/testing/content/files/en-us/web/css/number/index.html @@ -1,11 +1,7 @@ --- title: slug: Web/CSS/number -tags: - - CSS - - CSS Data Type - - Layout - - Reference - - Web +page-type: css-type --- +

You've reached the number test page.