From 4c9e6efc70b069b279e0e009e4dd836015bbf4df Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 26 Dec 2021 03:05:58 +0100 Subject: separate blocking for separate contexts (audio links now have their own allowlist, which won't put things through the dereferrer) --- lib/LintConfig.hs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib/LintConfig.hs') diff --git a/lib/LintConfig.hs b/lib/LintConfig.hs index 1e9e538..904d930 100644 --- a/lib/LintConfig.hs +++ b/lib/LintConfig.hs @@ -130,15 +130,18 @@ patch x y = to (gappend (from x) (from y)) patchConfig :: LintConfig Identity -> Maybe (LintConfig Maybe) -> LintConfig Identity patchConfig config p = config' - { configUriSchemas = M.adjust assemblysubst "world" $ configUriSchemas config'} + { configUriSchemas = ("world", assemblysubsts) : configUriSchemas config'} where config' = case p of Just p -> patch config p Nothing -> config - assemblysubst = \case - DomainSubstitution subst scope -> - DomainSubstitution (subst <> M.fromList generated) scope - where generated = (\slug -> (slug, "/@/rc3_21/"<>slug)) <$> configAssemblies config' - other -> other + assemblysubsts = + DomainSubstitution (M.fromList generated) scope + where generated = (\slug -> (slug, "/@/rc3_21/"<>slug)) <$> configAssemblies config' + scope = (\(DomainSubstitution _ s) -> s) + . snd . head + . filter ((==) "world" . fst) + $ configUriSchemas config' + instance (FromJSON (LintConfig a)) => Argument (LintConfig a) where parseArgument str = -- cgit v1.2.3