scripths 0.2.0.0 → 0.2.0.1
raw patch · 4 files changed
+23/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- scripths.cabal +1/−1
- src/ScriptHs/Markdown.hs +1/−1
- test/Test/Markdown.hs +17/−0
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for scripths +## 0.2.0.1 -- 2026-03-01++* Fix issue with SVG mime type.+ ## 0.2.0.0 -- 2026-03-01 * Add mime type to output.
scripths.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: scripths-version: 0.2.0.0+version: 0.2.0.1 synopsis: GHCi scripts for standalone execution and Markdown documentation. description: GHCi scripts for standalone execution (with dependency resolution) and Markdown documentation (produces inline output). homepage: https://www.datahaskell.org/
src/ScriptHs/Markdown.hs view
@@ -101,7 +101,7 @@ mimeFromTag t | T.isInfixOf "text/html" t = MimeHtml | T.isInfixOf "text/markdown" t = MimeMarkdown- | T.isInfixOf "image/svg+html" t = MimeSvg+ | T.isInfixOf "image/svg+xml" t = MimeSvg | T.isInfixOf "text/latex" t = MimeLatex | T.isInfixOf "application/json" t = MimeJson | T.isInfixOf "base64" t =
test/Test/Markdown.hs view
@@ -91,6 +91,23 @@ case segs of [(CodeBlock _ _ (Just (CodeOutput m _))), Prose _] -> assertBool "mime is latex" (m == MimeLatex) other -> assertFailure $ "expected [CodeBlock, Prose], got: " ++ show other+ , testCase "svg mimetype" $ do+ let input =+ T.unlines+ [ "```haskell"+ , "print 42"+ , "```"+ , ""+ , "> <!-- sabela:mime image/svg+xml -->"+ , "> <svg></svg>"+ , ""+ , "Some text after."+ ]+ let segs = parseMarkdown input+ length segs @?= 2+ case segs of+ [(CodeBlock _ _ (Just (CodeOutput m _))), Prose _] -> assertBool "mime is svg" (m == MimeSvg)+ other -> assertFailure $ "expected [CodeBlock, Prose], got: " ++ show other , testCase "multiple code blocks" $ do let input = T.unlines