Skip to content

Commit deb43b4

Browse files
shivamhwpcodex
andcommitted
fix(mobile): bound table cell backslash matching
Co-authored-by: GPT-6.1 Sol <[email protected]>
1 parent d51c008 commit deb43b4

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎patches/[email protected]‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ diff --git a/android/src/main/java/com/swmansion/enriched/markdown/utils/common/
1717
return buffer.toString()
1818
}
1919

20-
+ private val tableCellLineBreak = Regex("""(\\*)\n""")
20+
+ private val tableCellLineBreak = Regex("""(?<!\\)(\\*)\n""")
2121
+
2222
+ /** Serializes a table cell's content; a newline inside it becomes `<br>` so the row stays on one line. */
2323
+ fun serializeTableCell(cell: MarkdownASTNode): String =
@@ -81,7 +81,7 @@ diff --git a/ios/utils/MarkdownASTSerializer.m b/ios/utils/MarkdownASTSerializer
8181
+ NSString *markdown = markdownFromASTNodeChildren(node);
8282
+ if (![markdown containsString:@"\n"])
8383
+ return markdown;
84-
+ return [markdown stringByReplacingOccurrencesOfString:@"(\\\\*)\n"
84+
+ return [markdown stringByReplacingOccurrencesOfString:@"(?<!\\\\)(\\\\*)\n"
8585
+ withString:@"$1$1<br>"
8686
+ options:NSRegularExpressionSearch
8787
+ range:NSMakeRange(0, markdown.length)];

‎pnpm-lock.yaml‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)