Keep a description's headings, bullets and paragraphs, and draw them in the reader

The readers flattened a posting's HTML into one line with strip_html, so
sections and bullets ran together. _shared.html_text gives a line per
paragraph, '• ' before a list item and '## ' before a heading; every
reader's description goes through it, sections read per role get their
own headings, and the reader pane draws the lines as h3, ul and p.
Excerpts leave the marks out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 21:40:12 +02:00
1 parent 17e7615599
commit c497fe965d
44 files changed
+300 -147

No files matched your search

+3 -3
View File
@@ -205,7 +205,7 @@ def test_detail_reads_the_description_from_the_json_ld() -> None:
row = _rows()[0]
got = phenom.detail(_get_of("phenom-detail.html", asked), SLUG, row)
assert asked == [(row["url"], {"Accept": "text/html"})]
assert got["description"].startswith("Craft: Data, Analytics & Strategy")
assert got["description"].startswith("## Craft:\nData, Analytics & Strategy")
assert "<" not in got["description"] and "&lt;" not in got["description"]
assert "&amp;" not in got["description"]
assert got["posted"].isoformat() == "2026-09-28T00:00:00+00:00"
@@ -215,7 +215,7 @@ def test_detail_reads_the_description_from_the_json_ld() -> None:
def test_detail_finds_the_job_posting_among_other_blocks_and_takes_its_date() -> None:
got = phenom.detail(_get_of("phenom-detail-2.html", []), "www.careers.philips.com/global/en",
{"url": "https://www.careers.philips.com/global/en/job/1/x"})
assert got["description"].startswith("Job Title Zone Business Leader Imaging Nordics")
assert got["description"].startswith("## Job Title\nZone Business Leader Imaging Nordics")
assert got["posted"].isoformat() == "2026-09-08T00:00:00+00:00"
@@ -224,7 +224,7 @@ def test_detail_falls_back_to_the_page_state_where_there_is_no_job_posting() ->
`WebPage` one, and the role in the state the page assigns to `phApp.ddo`."""
row = _rows()[0]
got = phenom.detail(_get_of("phenom-detail-3.html", []), SLUG, row)
assert got["description"].startswith("Craft: Games Design & Production Job Description:")
assert got["description"].startswith("## Craft:\nGames Design & Production\n## Job Description:")
assert "<" not in got["description"] and "&amp;" not in got["description"]
assert got["remote"] == "On-site"
assert "posted" not in got and set(got) <= set(ats.DETAIL_FIELDS)