Skip to content
SprecherEast
Issue 1482

Local Scout: markup that arrives escaped twice is stripped from item text

Back to our plan
Open
bugtoolingpriority: low

Problem

In plain words: some items from the City's feeds show up with stray <p> tags in the text our AI agents read, because the feed sends its markup escaped twice and the runner decodes it after it strips tags.

Found in the review of #1481 (the police incident reports feed): updated reports carry literal <p> tags in sourceText. runner/lib/text.mjs strips tags first and decodes entities after, so double-escaped markup (&amp;lt;p&amp;gt;) comes out as tags again. That contradicts the file's own rule that markup is removed before any model sees it. The helper is older code; this feed is the first to expose it.

Proposed fix

Strip markup after decoding entities (or decode until stable, with a limit), keeping the existing script and style removal and the angle-bracket removal.

Acceptance criteria

  • Not done: A test with a double-escaped <p> shows no tag in sourceText.
  • Not done: Every existing text and parser test still passes.

Files likely touched

intelligence/runner/lib/text.mjs, intelligence/runner/test/

Must not touch

src/

Existing work compared

Searched open and closed issues for the text helper and for escaping; none. #993 and #1481 only record where it was found.

Area

tooling

Priority

low


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab