Skip to content

URL formatter can restore code blocks into user-authored placeholder text #109

Description

@rissrice2105-agent

Summary

convertUrlsToLinks() temporarily replaces fenced code blocks with predictable placeholders such as __CODE_BLOCK_0__. If a user message already contains that literal text, the restore step can inject the code block HTML at the user-authored placeholder and leave the real code block placeholder behind.

Reproduction

Convert a message like:

literal __CODE_BLOCK_0__ here
```js
console.log(1)

### Current behavior
The code block can be restored into the literal `__CODE_BLOCK_0__` text, while the actual code block location is left as a placeholder.

### Expected behavior
User-authored text should remain text, and only internal placeholders generated for this conversion pass should be restored.

### Impact
Messages with placeholder-like text render incorrectly and code blocks can appear in the wrong location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions