fix: keep bold labels in nested profile blocks

The nested list structure stays, so each label renders bold instead of showing its asterisks. The platform details block becomes a list as well: its labels were paragraphs followed by items with no blank line between them. validate_site now reports any asterisks that reach a rendered page outside code, which runs in the deploy and in pipeline step 8b.
This commit is contained in:
Abdessamad Derraz committed 2026-10-20 12:46:37 +02:00
1 parent f8fc9a672e
commit 721622c2ea
5 files changed
+63 -9

No files matched your search

+16 -1
View File
@@ -858,9 +858,24 @@ class NestedProfileBlocksRenderAsLists(unittest.TestCase):
"tmss": {"supported": True}})
self.assertNotIn("<pre>", html)
self.assertNotIn("**", html)
self.assertIn("external required: no", html)
self.assertIn("<strong>external required:</strong> no", html)
self.assertIn("<code>a.c:1</code>", html)
def test_platform_details_are_a_list(self):
import generate_site
lines = generate_site._render_platform_details(
{"platform_details": {"megacd": {"root": "x"}, "note": "y"}}
)
lines[0] = lines[0].replace("???+", "!!!")
try:
import markdown
except ImportError:
self.skipTest("markdown is not installed")
html = markdown.markdown("\n".join(lines), extensions=["admonition"])
self.assertIn("<li>root: x</li>", html)
self.assertNotIn("**", html)
def test_a_list_under_a_key_is_a_sublist(self):
html = self._html({"roms": [{"name": "a.bin", "size": 2}, "b.bin"]})
self.assertNotIn("<pre>", html)
+25 -3
View File
@@ -100,9 +100,9 @@ class PlatformDetails(unittest.TestCase):
"root": "<system_dir>/x",
}}}
)
self.assertIn(" - extensions_tried: .bin, .zip", lines)
self.assertIn(" - hle_available: no", lines)
self.assertIn(" - root: &lt;system_dir>/x", lines)
self.assertIn(" - extensions_tried: .bin, .zip", lines)
self.assertIn(" - hle_available: no", lines)
self.assertIn(" - root: &lt;system_dir>/x", lines)
class RenderedSiteValidation(unittest.TestCase):
@@ -165,6 +165,28 @@ class RenderedSiteValidation(unittest.TestCase):
class UnrenderedMarkdown(unittest.TestCase):
"""The clownmdemu analysis block reached readers as "- **bios_hle:**
True": a list indented one level too deep, read as code."""
setUp = RenderedSiteValidation.setUp
tearDown = RenderedSiteValidation.tearDown
def test_asterisks_in_prose_fail_and_in_code_pass(self):
(self.site / "index.html").write_text(
_page("Home", "Unique home description.", "<p>- **bios_hle:** True</p>"),
encoding="utf-8",
)
issues = validate_site(self.site, self.config)
self.assertTrue(any("markdown left unrendered" in issue for issue in issues))
(self.site / "index.html").write_text(
_page("Home", "Unique home description.",
"<pre><code>a = 2 ** 8</code></pre><code>**/*.py</code>"),
encoding="utf-8",
)
self.assertEqual(validate_site(self.site, self.config), [])
class EveryTestDependencyIsInstalledInCi(unittest.TestCase):
"""The markdown rendering test skipped on every CI run: the test job
installed pyyaml and jsonschema only. A test that skips where it is