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

+2 -5
View File
@@ -38,18 +38,16 @@ roles).
from __future__ import annotations
import html
import json
import re
from collections.abc import Callable
from typing import Any
from urllib.parse import quote
from desk.sources import strip_html
from ._contract import Ask, Fields, Filters, Place, Reads, Row
from ._countries import name_of
from ._shared import Get, Page, add_place, is_web_url, only, parse_dt, place
from ._shared import Get, Page, add_place, html_text, is_web_url, only, parse_dt, place
READS = Reads(
scope="board", listing="paged", page_size=10, text="detail", complete="stated",
@@ -186,5 +184,4 @@ def detail(get: Get, slug: str, row: Row) -> dict[str, Any]:
data = answer.get("data") if isinstance(answer, dict) else None
if not isinstance(data, dict) or "jobDescription" not in data:
raise ValueError("not an Eightfold position: no data.jobDescription")
text = html.unescape(strip_html(data["jobDescription"] or ""))
return {"description": " ".join(text.split())}
return {"description": html_text(data["jobDescription"])}