From fc0a2398879f6aaddb06f003259ec6e092fb2a60 Mon Sep 17 00:00:00 2001 From: Subramanya Sastry Date: Fri, 10 Mar 2023 12:15:58 -0600 Subject: [PATCH] Document Parsoid's differing HTML for follows * Add a file-level comment in the cite tests file. * Document the CSS rule that hides the Parsoid HTML. Change-Id: I27dc6d5f6ab09b67e28ce88a2e13bf2d1a13e9c0 --- modules/ext.cite.style.css | 4 ++++ tests/parser/citeParserTests.txt | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/modules/ext.cite.style.css b/modules/ext.cite.style.css index 9b2581223..af0d7faaa 100644 --- a/modules/ext.cite.style.css +++ b/modules/ext.cite.style.css @@ -1,5 +1,9 @@ /* CSS for Parsoid Cite extension */ +/* Parsoid HTML emits tags for follows uses even though there is + * no visible output for follows. Parsoid does this to ensure it can + * roundtrip back the source wikitext after edits. + * However, since this HTML should not be rendered, we use CSS to hide it */ .mw-ref-follow { display: none; } diff --git a/tests/parser/citeParserTests.txt b/tests/parser/citeParserTests.txt index 395255414..cc48565a1 100644 --- a/tests/parser/citeParserTests.txt +++ b/tests/parser/citeParserTests.txt @@ -3,6 +3,10 @@ version=2 parsoid-compatible=wt2html !! end +# NOTE about Parsoid HTML for cite tests with follows. +# Parsoid HTML has s for follows because it needs to be able to roundtrip it back. +# This output is hidden from read views via CSS in ext.cite.style.css. + # Force the test runner to ensure the extension is loaded !! hooks ref