diff options
| author | tv <tv@krebsco.de> | 2026-09-30 05:02:08 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-09-30 05:08:54 +0200 |
| commit | f460d30844358ef65477457a106681dc420e6452 (patch) | |
| tree | 2a15607d18c84e48fc964824d828017b142d2541 /src/MdBlocks/Resolver.hs | |
| parent | 80efc38f395b9ee70545d586ef02c68cf952be8d (diff) | |
drop support for traversing directories
Diffstat (limited to 'src/MdBlocks/Resolver.hs')
| -rw-r--r-- | src/MdBlocks/Resolver.hs | 26 |
1 files changed, 4 insertions, 22 deletions
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 |
