|
3 | 3 | module Web.Atomic.Render where |
4 | 4 |
|
5 | 5 | import Data.ByteString.Lazy qualified as BL |
| 6 | +import Data.List qualified as L |
6 | 7 | import Data.Map.Strict (Map) |
7 | 8 | import Data.Map.Strict qualified as M |
8 | 9 | import Data.Maybe (mapMaybe) |
9 | 10 | import Data.String (IsString (..)) |
10 | 11 | import Data.Text (Text, intercalate, pack) |
11 | 12 | import Data.Text qualified as T |
12 | | -import Data.Text.Lazy qualified as L |
13 | | -import Data.Text.Lazy.Encoding qualified as LE |
| 13 | +import Data.Text.Lazy qualified as TL |
| 14 | +import Data.Text.Lazy.Encoding qualified as TLE |
14 | 15 | import HTMLEntities.Text qualified as HE |
15 | 16 | import Web.Atomic.Html |
16 | 17 | import Web.Atomic.Types |
17 | 18 |
|
18 | 19 |
|
19 | | -renderLazyText :: Html () -> L.Text |
20 | | -renderLazyText = L.fromStrict . renderText |
| 20 | +renderLazyText :: Html () -> TL.Text |
| 21 | +renderLazyText = TL.fromStrict . renderText |
21 | 22 |
|
22 | 23 |
|
23 | 24 | renderLazyByteString :: Html () -> BL.ByteString |
24 | | -renderLazyByteString = LE.encodeUtf8 . renderLazyText |
| 25 | +renderLazyByteString = TLE.encodeUtf8 . renderLazyText |
25 | 26 |
|
26 | 27 |
|
27 | 28 | {- | Renders a 'View' as HTML with embedded CSS class definitions |
@@ -178,7 +179,7 @@ addIndent n (Line e ind t) = Line e (ind + n) t |
178 | 179 |
|
179 | 180 | -- | Render lines to text |
180 | 181 | renderLines :: [Line] -> Text |
181 | | -renderLines = snd . foldl' nextLine (False, "") |
| 182 | +renderLines = snd . L.foldl' nextLine (False, "") |
182 | 183 | where |
183 | 184 | nextLine :: (Bool, Text) -> Line -> (Bool, Text) |
184 | 185 | nextLine (newline, t) l = (nextNewline l, t <> currentLine newline l) |
|
0 commit comments