Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(markdown): keep Windows paths intact in link and image destinations #12615

MergedSunkenInTime(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/12615/headmerged by juliusmarminge View on GitHub

Showing 5 changed files with 79 additions and 5 deletions (loading 2).

x
0 of 5 viewed, 5 left
5 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,10 @@
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;
30 additions and 0 deletionsapps/mobile/modules/t3-markdown-text/src/nativeMarkdownText.tsModified
View file
@@ -1,6 +1,7 @@
import type { MarkdownNode } from "react-native-nitro-markdown/headless";