diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-04 14:27:03 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-02-04 14:27:03 +0100 |
commit | c995e84d71d02ce705412b2e82f336079acbf605 (patch) | |
tree | 1e569c59f2910bdcf7f816beec8a96980ed05424 | |
parent | 05ae66bbb842c180cc39f22b2bdf7667f51138eb (diff) | |
download | dirty-haskell.org-c995e84d71d02ce705412b2e82f336079acbf605.tar dirty-haskell.org-c995e84d71d02ce705412b2e82f336079acbf605.tar.gz dirty-haskell.org-c995e84d71d02ce705412b2e82f336079acbf605.tar.bz2 dirty-haskell.org-c995e84d71d02ce705412b2e82f336079acbf605.tar.xz dirty-haskell.org-c995e84d71d02ce705412b2e82f336079acbf605.zip |
better alt text for math
-rw-r--r-- | src/Site.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Site.hs b/src/Site.hs index 03b6e16..bf501d8 100644 --- a/src/Site.hs +++ b/src/Site.hs | |||
@@ -214,16 +214,16 @@ texTransform :: Pandoc -> Compiler Pandoc | |||
214 | texTransform = walkM texTransformInline <=< walkM texTransformBlock | 214 | texTransform = walkM texTransformInline <=< walkM texTransformBlock |
215 | where | 215 | where |
216 | texTransformInline :: Inline -> Compiler Inline | 216 | texTransformInline :: Inline -> Compiler Inline |
217 | texTransformInline (Math mathType tex) = (\html -> Span ("", [classOf mathType], []) [RawInline "html" html]) <$> texTransform' (wrapMath tex) | 217 | texTransformInline (Math mathType tex) = (\html -> Span ("", [classOf mathType], []) [RawInline "html" html]) <$> texTransform' wrapMath tex |
218 | texTransformInline (RawInline "latex" tex) = (\html -> Span ("", [], []) [RawInline "html" html]) <$> texTransform' tex | 218 | texTransformInline (RawInline "latex" tex) = (\html -> Span ("", [], []) [RawInline "html" html]) <$> texTransform' id tex |
219 | texTransformInline x = return x | 219 | texTransformInline x = return x |
220 | texTransformBlock :: Block -> Compiler Block | 220 | texTransformBlock :: Block -> Compiler Block |
221 | texTransformBlock (RawBlock "latex" tex) = (\html -> Div ("", [], []) [RawBlock "html" html]) <$> texTransform' tex | 221 | texTransformBlock (RawBlock "latex" tex) = (\html -> Div ("", [], []) [RawBlock "html" html]) <$> texTransform' id tex |
222 | texTransformBlock x = return x | 222 | texTransformBlock x = return x |
223 | texTransform' :: String -> Compiler String | 223 | texTransform' :: (String -> String) -> String -> Compiler String |
224 | texTransform' tex = do | 224 | texTransform' texT tex = do |
225 | let | 225 | let |
226 | texId = texTranslation' tex | 226 | texId = texTranslation' $ texT tex |
227 | alignment <- loadSnapshotBody texId "alignment" | 227 | alignment <- loadSnapshotBody texId "alignment" |
228 | return $ printf "<object data=\"/%s\" type=\"image/svg+xml\" style=\"vertical-align:-%s\">%s</object>" | 228 | return $ printf "<object data=\"/%s\" type=\"image/svg+xml\" style=\"vertical-align:-%s\">%s</object>" |
229 | (toFilePath texId) (alignment :: String) tex | 229 | (toFilePath texId) (alignment :: String) tex |