translate _ to space in pathToLabel

This commit is contained in:
Rhiannon Morris 2021-03-20 11:07:51 +01:00
parent ace57a50f9
commit 8b25a3d712
1 changed files with 2 additions and 2 deletions

View File

@ -272,8 +272,8 @@ unlabelledImage' label' y = asStr y <|> asObj y
warning <- m .:? "warning"
let label = fromMaybe (pathToLabel path) label'
pure $ Image {label, path, download, nsfw, warning}
pathToLabel = Text.pack . dashToSpace . takeBaseName
dashToSpace = map \case '-' -> ' '; c -> c
pathToLabel = Text.pack . gapToSpace . takeBaseName
gapToSpace = map \case '-' -> ' '; '_' -> ' '; c -> c
instance FromYAML Link where
parseYAML =