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 {
195195object MarkdownConverter {
196196 def splitWikiLink (chars : String ): (String , String ) =
197197 // 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 {
199199 case Array (target) => (target, " " )
200200 case Array (target, userText) => (target, userText)
201201 }
Original file line number Diff line number Diff line change @@ -8,5 +8,6 @@ class MarkdownConverterTests {
88 assertEquals((" a" , " b c d" ), MarkdownConverter .splitWikiLink(" a b c d" ))
99 assertEquals((" a" , " b\\ c d" ), MarkdownConverter .splitWikiLink(" a b\\ c d" ))
1010 assertEquals((" a\\ b" , " c d" ), MarkdownConverter .splitWikiLink(" a\\ b c d" ))
11+ assertEquals((" a\\\\ " , " b c d" ), MarkdownConverter .splitWikiLink(" a\\\\ b c d" ))
1112 }
1213}
You can’t perform that action at this time.
0 commit comments