From f460d30844358ef65477457a106681dc420e6452 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 30 Sep 2026 05:02:08 +0200 Subject: drop support for traversing directories --- src/MdBlocks/Resolver.hs | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'src/MdBlocks/Resolver.hs') diff --git a/src/MdBlocks/Resolver.hs b/src/MdBlocks/Resolver.hs index c6e94d1..29c1658 100644 --- a/src/MdBlocks/Resolver.hs +++ b/src/MdBlocks/Resolver.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE OverloadedStrings #-} - module MdBlocks.Resolver ( resolveBlock ) @@ -14,26 +12,10 @@ resolveBlock :: Address -> [Block] -> Maybe Block - -resolveBlock (GlobalId ident) blocks = - findById ident blocks - -resolveBlock (FileAddress fp ident) blocks = - findByFileAndId fp ident blocks - -findById :: Text -> [Block] -> Maybe Block -findById ident = - go - where - go [] = - Nothing - - go (b:bs) - | mdId (blockMeta b) == Just ident = - Just b - - | otherwise = - go bs +resolveBlock address = + findByFileAndId + (addressFile address) + (addressId address) findByFileAndId :: FilePath -- cgit v1.3.1