Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 2bbd1fc

Browse files
authored
Merge pull request #83 from cryogenian/backslash-r
backslash-r replacements
2 parents 6303d0d + 9fee514 commit 2bbd1fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Text/Markdown/SlamDown/Parser.purs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import Data.List as L
1313
import Data.Maybe as M
1414
import Data.Monoid (mempty)
1515
import Data.String as S
16+
import Data.String.Regex as RGX
17+
import Data.String.Regex.Unsafe as URX
18+
import Data.String.Regex.Flags as RXF
1619
import Data.Traversable (traverse)
1720
import Data.Validation.Semigroup as V
1821

@@ -372,6 +375,7 @@ tabsToSpaces = S.replace (S.Pattern "\t") (S.Replacement " ")
372375
parseMd a. (SD.Value a) String Either String (SD.SlamDownP a)
373376
parseMd s = map SD.SlamDown bs
374377
where
375-
lines = L.fromFoldable $ S.split (S.Pattern "\n") $ S.replace (S.Pattern "\r") (S.Replacement "") $ tabsToSpaces s
378+
slashR = URX.unsafeRegex "\\r" RXF.global
379+
lines = L.fromFoldable $ S.split (S.Pattern "\n") $ RGX.replace slashR "" $ tabsToSpaces s
376380
ctrs = parseContainers mempty lines
377381
bs = parseBlocks ctrs

0 commit comments

Comments
 (0)