@@ -7,13 +7,14 @@ import Prelude
77
88import Data.Array as A
99import Data.Foldable (fold , elem )
10- import Data.Functor.Compose (Compose , decompose )
10+ import Data.Functor.Compose (Compose )
1111import Data.HugeNum as HN
1212import Data.Identity (Identity (..))
1313import Data.List as L
1414import Data.Maybe as M
1515import Data.Monoid (mempty )
1616import Data.String as S
17+ import Data.Newtype (unwrap )
1718import Data.Unfoldable as U
1819
1920import Text.Markdown.SlamDown.Syntax as SD
@@ -35,7 +36,7 @@ overLines f = map f <<< L.concatMap lines
3536
3637lines ∷ String → L.List String
3738lines " " = mempty
38- lines s = L .fromFoldable $ S .split " \n " s
39+ lines s = L .fromFoldable $ S .split ( S.Pattern " \n " ) s
3940
4041prettyPrintBlock ∷ ∀ a . (SD.Value a ) ⇒ SD.Block a → L.List String
4142prettyPrintBlock bl =
@@ -102,7 +103,7 @@ prettyPrintInline il =
102103 esc l <> star <> " = " <> prettyPrintFormElement e
103104 where
104105
105- esc s = M .maybe s (const $ " [" <> s <> " ]" ) $ S .indexOf " " s
106+ esc s = M .maybe s (const $ " [" <> s <> " ]" ) $ S .indexOf ( S.Pattern " " ) s
106107
107108 printTarget ∷ SD.LinkTarget → String
108109 printTarget (SD.InlineLink url) = parens url
@@ -115,7 +116,7 @@ prettyPrintTextBoxValue t =
115116 SD.PlainText (Identity def) → def
116117 SD.Numeric (Identity def) →
117118 let s = HN .toString def in
118- M .fromMaybe s $ S .stripSuffix " ." $ HN .toString def
119+ M .fromMaybe s $ S .stripSuffix ( S.Pattern " ." ) $ HN .toString def
119120 SD.Date (Identity def) → prettyPrintDate def
120121 SD.Time prec (Identity def) → prettyPrintTime prec def
121122 SD.DateTime prec (Identity def) → prettyPrintDateTime prec def
@@ -155,7 +156,7 @@ printIntPadded l i =
155156prettyPrintTextBox ∷ SD.TextBox (Compose M.Maybe SD.Expr ) → String
156157prettyPrintTextBox t =
157158 prettyPrintTemplate t
158- <> M .maybe " " (\x → " (" <> prettyPrintDefault x <> " )" ) (SD .traverseTextBox decompose t)
159+ <> M .maybe " " (\x → " (" <> prettyPrintDefault x <> " )" ) (SD .traverseTextBox unwrap t)
159160 where
160161 prettyPrintTemplate ∷ ∀ f . SD.TextBox f → String
161162 prettyPrintTemplate t =
0 commit comments