Files
paseo/packages/app/src/utils/assistant-markdown-parser.ts
T
Mohamed Boudra 5d70ab2ab8 fix(app): restore character-paced streaming replies (#5013)
* fix(app): restore character-paced streaming reveal

Restore the v0.8 character reveal model and remove the word-level fade implementation so streamed assistant and reasoning text remains opaque, grapheme-safe, and immediately completes when a turn ends.

* fix(android): preserve inverted timeline selection

React Native's prebuilt Android library does not consume source patches under node_modules. Register the compiled scroll manager before the core package so inverted child-reveal calculations leave focus and text selection in place while normal and explicit scrolling remain unchanged.
2026-09-17 18:32:12 +02:00

20 lines
735 B
TypeScript

import type MarkdownIt from "markdown-it";
import { createMarkdownParser } from "@/utils/markdown-parser";
import { enableStreamingMarkdown } from "@/utils/streaming-markdown";
export function createAssistantMarkdownParser({ streaming = false } = {}): MarkdownIt {
const parser = createMarkdownParser({ linkify: true });
const defaultValidateLink = parser.validateLink.bind(parser);
// Assistant messages are the only surface allowed to link into the
// filesystem. Every other parser keeps markdown-it's stricter default.
parser.validateLink = (url: string) =>
url.trim().toLowerCase().startsWith("file://") || defaultValidateLink(url);
if (streaming) {
enableStreamingMarkdown(parser);
}
return parser;
}