Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(markdown): keep backslashes in Windows image and link paths #14262

Closedbugulo(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/14262/headopened View on GitHub

Showing 6 changed files with 105 additions and 5 deletions (loading 3).

x
0 of 6 viewed, 6 left
9 additions and 5 deletionsapps/mobile/modules/t3-markdown-text/src/SelectableMarkdownText.tsxModified
View file
@@ -6,6 +6,7 @@
nativeMarkdownChunkSpacing,
nativeMarkdownDocumentChunks,
nativeMarkdownDocumentRuns,
+ nativeMarkdownWithAuthoredWindowsPaths,
nativeMarkdownWithPreservedSoftBreaks,
} from "./nativeMarkdownText";
import { MarkdownImageRendererContext, NativeMarkdownBlock } from "./NativeMarkdownBlock";
@@ -51,11 +52,14 @@
marginBottom = 0,
}: SelectableMarkdownTextProps) {
const chunks = useMemo(() => {
- const parsedDocument = parseMarkdownWithOptions(markdown, {
- gfm: true,
- html: true,
- math: false,
- });
+ const parsedDocument = nativeMarkdownWithAuthoredWindowsPaths(
+ parseMarkdownWithOptions(markdown, {
+ gfm: true,
+ html: true,
+ math: false,
+ }),
+ markdown,
+ );
const document = preserveSoftBreaks
? nativeMarkdownWithPreservedSoftBreaks(parsedDocument)
: parsedDocument;