Skip to content

.llm.md loses line breaks inside posts #57

Description

@wolfgang-aura

Impact: the .llm.md (what an AI link serves) loses every line break inside a post. A post written as a list or as short lines arrives as one run-on line, e.g. Three rules:\n1. Ship\n2. Measure\n3. Repeat becomes Three rules: 1. Ship 2. Measure 3. Repeat. The HTML keeps the breaks (pre-wrap), so the two outputs disagree.

Where: renderLlmBlocks renders paragraphs with textFromHtml(b.html) (sourcecapsule.user.js ~4707). textFromHtml turns <br> into \n and then runs .replace(/\s+/g, ' '), which collapses those newlines and the literal \n X keeps in tweetText.

Evidence: Node repro against the engine export: inlineHtmlFromTweetText yields "Three rules:\n1. Ship\n2. Measure\n3. Repeat", renderLlmMarkdown emits Three rules: 1. Ship 2. Measure 3. Repeat, and assembleHtml keeps the newlines.

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

Next action: render paragraphs for Markdown with a newline-preserving variant (collapse spaces/tabs only, keep \n). Neutralize a leading #, >, - or 1. on continuation lines so post text cannot open its own Markdown sections once breaks survive. Add a smoke assertion for a multi-line post.

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