Skip to content

Render Markdown descriptions to HTML in RSS/ICS exports #50

Description

@hhkaos

OTE's description field is documented as "Plain text or Markdown," but both exporters treated it as plain text only:

  • export-rss escaped it and turned newlines into <br/> — Markdown syntax (**bold**, [link](url), lists) leaked through literally instead of rendering, even though RSS 2.0's <description> commonly holds entity-encoded HTML that readers render.
  • export-ics put it straight into DESCRIPTION, which per RFC 5545 is TEXT-only and can't hold markup at all.

Fix:

  • export-rss: description is now rendered to HTML with marked before being embedded in the item body (still entity-encoded once for the XML document, same as before).
  • export-ics: added X-ALT-DESC;FMTTYPE=text/html — the de facto (non-standard but widely implemented — Outlook 2007+, Thunderbird/Lightning) rich-text extension — carrying the Markdown rendered to HTML, built from the same parts as DESCRIPTION (online link, moved-online note, cfp/eligibility/offers) since Outlook ignores DESCRIPTION entirely once X-ALT-DESC is present. Plain-text DESCRIPTION stays unchanged, for Google Calendar and any other client that ignores X-ALT-DESC.
  • Both: raw inline/block HTML found inside the Markdown source is escaped rather than passed through live.
  • export-rss's reverse-parser (parse.ts, used by apps/preview) was reading only <p> elements from the item body; fixed to read every top-level block, since Markdown can now produce <ul>/<h2>/etc. too.

Scoped to event.description only — feed/channel-level description is plain "Short description of the feed" in the schema, not documented as Markdown, so it's untouched.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttool:export-icsOTE -> iCalendar (packages/export-ics)tool:export-rssOTE -> RSS/JSON Feed (packages/export-rss)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions