Skip to content

Commit

Permalink
Update plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonkearns committed May 19, 2023
1 parent d873003 commit 2e3d8d0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions plugins/MarkdownCodec.elm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ noteTitle filePath =
|> BackendTask.andThen
(\rawContent ->
Markdown.Parser.parse rawContent
|> Result.mapError (\_ -> "Markdown error")
|> Result.mapError (\_ -> FatalError.fromString "Markdown error")
|> Result.map
(\blocks ->
List.Extra.findMap
Expand All @@ -76,9 +76,8 @@ noteTitle filePath =
)
|> Result.andThen
(Result.fromMaybe <|
("Expected to find an H1 heading for page " ++ filePath)
FatalError.fromString ("Expected to find an H1 heading for page " ++ filePath)
)
|> Result.mapError FatalError.fromString
|> BackendTask.fromResult
)
)
Expand Down Expand Up @@ -106,7 +105,7 @@ titleAndDescription filePath =
|> BackendTask.andThen
(\rawContent ->
Markdown.Parser.parse rawContent
|> Result.mapError (\_ -> "Markdown error")
|> Result.mapError (\_ -> FatalError.fromString "Markdown error")
|> Result.map
(\blocks ->
Maybe.map
Expand All @@ -129,8 +128,7 @@ titleAndDescription filePath =
findH1 blocks
)
)
|> Result.andThen (Result.fromMaybe <| "Expected to find an H1 heading for page " ++ filePath)
|> Result.mapError FatalError.fromString
|> Result.andThen (Result.fromMaybe <| FatalError.fromString <| "Expected to find an H1 heading for page " ++ filePath)
|> BackendTask.fromResult
)
)
Expand Down

0 comments on commit 2e3d8d0

Please sign in to comment.