diff options
author | stuebinm | 2021-12-26 03:05:58 +0100 |
---|---|---|
committer | stuebinm | 2021-12-26 03:05:58 +0100 |
commit | 4c9e6efc70b069b279e0e009e4dd836015bbf4df (patch) | |
tree | fb9aecf1d3e7d80cd0e5a2bea71f4563704ec6dc /lib/LintConfig.hs | |
parent | 687e2369472a220293e89307493a21940ab8e4eb (diff) |
separate blocking for separate contexts
(audio links now have their own allowlist, which won't put things
through the dereferrer)
Diffstat (limited to '')
-rw-r--r-- | lib/LintConfig.hs | 15 |
1 files changed, 9 insertions, 6 deletions
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 = |