translate _ to space in pathToLabel
This commit is contained in:
parent
ace57a50f9
commit
8b25a3d712
1 changed files with 2 additions and 2 deletions
|
@ -272,8 +272,8 @@ unlabelledImage' label' y = asStr y <|> asObj y
|
||||||
warning <- m .:? "warning"
|
warning <- m .:? "warning"
|
||||||
let label = fromMaybe (pathToLabel path) label'
|
let label = fromMaybe (pathToLabel path) label'
|
||||||
pure $ Image {label, path, download, nsfw, warning}
|
pure $ Image {label, path, download, nsfw, warning}
|
||||||
pathToLabel = Text.pack . dashToSpace . takeBaseName
|
pathToLabel = Text.pack . gapToSpace . takeBaseName
|
||||||
dashToSpace = map \case '-' -> ' '; c -> c
|
gapToSpace = map \case '-' -> ' '; '_' -> ' '; c -> c
|
||||||
|
|
||||||
instance FromYAML Link where
|
instance FromYAML Link where
|
||||||
parseYAML =
|
parseYAML =
|
||||||
|
|
Loading…
Reference in a new issue