diff --git a/guide.cabal b/guide.cabal index c954f45..e276d2c 100644 --- a/guide.cabal +++ b/guide.cabal @@ -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 diff --git a/src/Markdown.hs b/src/Markdown.hs index 0651ed2..b4b7955 100644 --- a/src/Markdown.hs +++ b/src/Markdown.hs @@ -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 diff --git a/src/View.hs b/src/View.hs index 708a104..ecf3b7a 100644 --- a/src/View.hs +++ b/src/View.hs @@ -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