EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...
    • Replace the inner body of the Executive Brief section (the <h2 id="section-executive-brief">…</h2> heading and everything that follows it up to — but not including — the next <h2 id="section-…"> sibling) with the supplied replacement HTML. The Executive Brief heading itself is preserved by emitting it inline ahead of the replacement, so the in-page anchor (#section-executive-brief) and the table-of-contents link continue to work.

      Used by the article-generator HTML pipeline to inject the rendered markdown of a translated executive-brief_<lang>.md into the non-English language variants without forking the whole aggregated article into 14 source-language copies — see editorial-brief-resolver.readLocalizedBriefBody and render-one.writeLanguageVariant.

      Implementation uses indexOf/slice exclusively to stay within CodeQL's safe-regex envelope. Returns html unchanged when the Executive Brief heading is absent or malformed.

      Parameters

      • html: string

        Full article body HTML

      • localizedHeading: string

        Localized text for the Executive Brief H2 (e.g. "Sammanfattning" for sv). Must be plain text — caller is responsible for any escaping (it's passed through escapeHTML).

      • replacementBodyHtml: string

        HTML to splice in after the heading. Should not contain its own <h2> for the Executive Brief — the heading is re-emitted by this helper.

      Returns string

      Updated HTML with the localized brief body in place.