mirror of
https://github.com/aelve/guide.git
synced 2024-12-23 12:52:31 +03:00
Switch to Megaparsec 5
This commit is contained in:
parent
dd6b38f742
commit
752864fc30
@ -66,7 +66,7 @@ executable guide
|
||||
, ilist
|
||||
, iproute == 1.7.*
|
||||
, lucid >= 2.9.5 && < 3
|
||||
, megaparsec == 4.4.*
|
||||
, megaparsec == 5.0.*
|
||||
, microlens-platform >= 0.3.2
|
||||
, mmorph == 1.*
|
||||
, mtl >= 2.1.1
|
||||
|
@ -48,6 +48,7 @@ import qualified Data.ByteString as BS
|
||||
import Data.ByteString (ByteString)
|
||||
-- Parsing
|
||||
import Text.Megaparsec hiding (State)
|
||||
import Text.Megaparsec.Text
|
||||
-- HTML
|
||||
import Lucid
|
||||
import Text.HTML.SanitizeXSS
|
||||
@ -212,8 +213,9 @@ parseLink :: Text -> Either String (Text, Maybe Text, Maybe Text)
|
||||
parseLink = either (Left . show) Right . parse p ""
|
||||
where
|
||||
shortcut = some (alphaNumChar <|> char '-')
|
||||
opt = char '(' *> some (noneOf ")") <* char ')'
|
||||
opt = char '(' *> some (noneOf [')']) <* char ')'
|
||||
text = char ':' *> some anyChar
|
||||
p :: Parser (Text, Maybe Text, Maybe Text)
|
||||
p = do
|
||||
char '@'
|
||||
(,,) <$> T.pack <$> shortcut
|
||||
|
@ -1159,9 +1159,6 @@ renderItemNotes category item = cached (CacheItemNotes (item^.uid)) $ do
|
||||
section "editing" [uid_ editingSectionUid] $
|
||||
return ()
|
||||
|
||||
-- TODO: a shortcut for editing (when you press Ctrl-something, whatever was
|
||||
-- selected becomes editable)
|
||||
|
||||
renderItemForFeed :: Monad m => Category -> Item -> HtmlT m ()
|
||||
renderItemForFeed category item = do
|
||||
h1_ $ renderItemTitle item
|
||||
|
Loading…
Reference in New Issue
Block a user