File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,7 @@ class MarkdownConverter(val repr: Repr) extends BaseConverter {
195
195
object MarkdownConverter {
196
196
def splitWikiLink (chars : String ): (String , String ) =
197
197
// split on a space which is not backslash escaped (regex uses "zero-width negative lookbehind")
198
- chars.split(" (?<!\\\\ ) " , /* max*/ 2 ) match {
198
+ chars.split(" (?<!(?<! \\\\ ) \\\\ ) " , /* max*/ 2 ) match {
199
199
case Array (target) => (target, " " )
200
200
case Array (target, userText) => (target, userText)
201
201
}
Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ class MarkdownConverterTests {
8
8
assertEquals((" a" , " b c d" ), MarkdownConverter .splitWikiLink(" a b c d" ))
9
9
assertEquals((" a" , " b\\ c d" ), MarkdownConverter .splitWikiLink(" a b\\ c d" ))
10
10
assertEquals((" a\\ b" , " c d" ), MarkdownConverter .splitWikiLink(" a\\ b c d" ))
11
+ assertEquals((" a\\\\ " , " b c d" ), MarkdownConverter .splitWikiLink(" a\\\\ b c d" ))
11
12
}
12
13
}
You can’t perform that action at this time.
0 commit comments