From 467b9b7e6234acd51ab0e2e828a108ac6f8ad427 Mon Sep 17 00:00:00 2001 From: myfreeer Date: Sun, 3 Mar 2024 11:34:30 +0800 Subject: [PATCH] mdn: temporarily remove link to standalone play page Part of https://github.com/website-local/mdn-local/issues/975 --- src/mdn/process-html/process-remove-elements.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/mdn/process-html/process-remove-elements.ts b/src/mdn/process-html/process-remove-elements.ts index b242c40..a52273d 100644 --- a/src/mdn/process-html/process-remove-elements.ts +++ b/src/mdn/process-html/process-remove-elements.ts @@ -95,4 +95,14 @@ export const preProcessRemoveElements = ($: CheerioStatic): void => { // https://github.com/website-local/mdn-local/issues/973 $('.baseline-indicator a.learn-more').parent().remove(); $('.baseline-indicator a.feedback-link').parent().remove(); + // 20240303 temporarily remove link to standalone play page + // Part of https://github.com/website-local/mdn-local/issues/975 + // Would be reverted if this fully implemented + $('a.top-level-entry.menu-link').each((i, el) => { + const e = $(el); + const href = e.attr('href'); + if (href?.endsWith('/play') && e.text().trim() === 'Play') { + e.parent().remove(); + } + }); };