Download app/vendor/pi-coding-agent/components/markdown-transform.js from Mike0021/MiniCPM5-2B-WebGPU-Pi-HTTP: direct link, hf CLI and curl.
- Browser
- Download file 786 Bytes
-
https://huggingface.co/spaces/Mike0021/MiniCPM5-2B-WebGPU-Pi-HTTP/resolve/main/app/vendor/pi-coding-agent/components/markdown-transform.js
- Command line
-
hf download hf://spaces/Mike0021/MiniCPM5-2B-WebGPU-Pi-HTTP/app/vendor/pi-coding-agent/components/markdown-transform.js
-
curl -L -o markdown-transform.js https://huggingface.co/spaces/Mike0021/MiniCPM5-2B-WebGPU-Pi-HTTP/resolve/main/app/vendor/pi-coding-agent/components/markdown-transform.js
786 Bytes
| export function createMarkdownTransform(messageType, isStreaming, transformers) { | |
| return (markdown, availableWidth) => applyMarkdownTransformers(markdown, { messageType, isStreaming, availableWidth }, transformers); | |
| } | |
| function applyMarkdownTransformers(markdown, context, transformers) { | |
| let transformedMarkdown = markdown; | |
| for (const transformer of transformers) { | |
| try { | |
| const transformed = transformer(transformedMarkdown, context); | |
| if (typeof transformed === "string") { | |
| transformedMarkdown = transformed; | |
| } | |
| } | |
| catch { | |
| // Keep the current Markdown and continue with the next transformer. | |
| } | |
| } | |
| return transformedMarkdown; | |
| } | |
| //# sourceMappingURL=markdown-transform.js.map |