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

Commit

Permalink
Merge pull request #83 from cryogenian/backslash-r
Browse files Browse the repository at this point in the history
backslash-r replacements
  • Loading branch information
cryogenian authored Dec 7, 2017
2 parents 6303d0d + 9fee514 commit 2bbd1fc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Text/Markdown/SlamDown/Parser.purs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ import Data.List as L
import Data.Maybe as M
import Data.Monoid (mempty)
import Data.String as S
import Data.String.Regex as RGX
import Data.String.Regex.Unsafe as URX
import Data.String.Regex.Flags as RXF
import Data.Traversable (traverse)
import Data.Validation.Semigroup as V

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

0 comments on commit 2bbd1fc

Please sign in to comment.