This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
src/Text/Markdown/SlamDown Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ import Data.List as L
1313import Data.Maybe as M
1414import Data.Monoid (mempty )
1515import 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
1619import Data.Traversable (traverse )
1720import Data.Validation.Semigroup as V
1821
@@ -372,6 +375,7 @@ tabsToSpaces = S.replace (S.Pattern "\t") (S.Replacement " ")
372375parseMd ∷ ∀ a . (SD.Value a ) ⇒ String → Either String (SD.SlamDownP a )
373376parseMd 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
You can’t perform that action at this time.
0 commit comments