Skip to content

Instantly share code, notes, and snippets.

@rwst
Created November 20, 2011 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rwst/1380600 to your computer and use it in GitHub Desktop.
Save rwst/1380600 to your computer and use it in GitHub Desktop.
proposed patch to pandoc-types, simple addition of String parameter to Image
diff --git a/Text/Pandoc/Builder.hs b/Text/Pandoc/Builder.hs
index 664c656..e062271 100644
--- a/Text/Pandoc/Builder.hs
+++ b/Text/Pandoc/Builder.hs
@@ -269,8 +269,9 @@ link url title x = singleton $ Link (toList x) (url, title)
image :: String -- ^ URL
-> String -- ^ Title
-> Inlines -- ^ Alt text
+ -> String -- ^ Size information (i.e. width)
-> Inlines
-image url title x = singleton $ Image (toList x) (url, title)
+image url title x size = singleton $ Image (toList x) (url, title) size
note :: Blocks -> Inlines
note = singleton . Note . toList
diff --git a/Text/Pandoc/Definition.hs b/Text/Pandoc/Definition.hs
index 0256643..d47e10c 100644
--- a/Text/Pandoc/Definition.hs
+++ b/Text/Pandoc/Definition.hs
@@ -134,7 +134,7 @@ data Inline
| RawInline Format String -- ^ Raw inline
| Link [Inline] Target -- ^ Hyperlink: text (list of inlines), target
| Image [Inline] Target -- ^ Image: alt text (list of inlines), target
- -- and target
+ String -- and target
| Note [Block] -- ^ Footnote or endnote
deriving (Show, Eq, Ord, Read, Typeable, Data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment