Skip to content

Multi-line alt text breaks .llm.md structure and bundle image embeds #62

Description

@wolfgang-aura

Impact: image alt text is written by the poster and can contain line breaks. The .llm.md writes it unescaped into the Media References - Alt: row and into the bundle's ![alt (id)](media/...) embed. A line break ends the embed, so Markdown viewers no longer render the image. A line in the alt text that starts with ## becomes a top-level section of the capsule, indistinguishable from SourceCapsule's own sections, for example a second ## Completeness.

A smaller defect in the same renderer: the quoted-post media list strips the trailing ] from bundle video lines and leaves [Video: ... source link preserved unclosed.

Where: sourcecapsule.user.js: llmMediaDescription (4656) passes alt text through markdownLineText (4302), which keeps \n despite its name. The Media References row comes from renderLlmMediaReference (4877). The quoted-post list (~4867) applies .replace(/^\[|\]$/g, ''), which strips only the closing bracket when the description starts with ![Poster of ...].

Evidence: Node repro with an image whose alt text contains a blank line followed by a ## heading line. The plain .llm.md gains two extra top-level sections, and the bundle embed spans seven lines. The bundle quoted-post list prints [Video: video-002 - full video not included in this bundle, poster frame media/video-002.poster.png, source link preserved with no closing bracket.

Environment: main 72777ef (v1.6.8). Engine loaded in Node through the module.exports guard. No browser.

Next action: collapse newlines to spaces for single-line Markdown contexts (alt text, link text, metadata rows) and escape [ and ] inside embed alt text. Strip the brackets only from the [Video: ...] tag itself, not from the joined description.

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions