- Nothing -> ("class", "inlineImage")
- Just "left" -> ("class", "inlineImage leftFloat")
- Just "right" -> ("class", "inlineImage rightFloat")
- Just others -> error ("unknown \"float\" attribute: " ++ others)
- anchorAttrs = [hrefAttr, classAttr]
-
- return (Anchor anchorAttrs [Image pageName alt])
+ Nothing → "inlineImage"
+ Just "left" → "inlineImage leftFloat"
+ Just "right" → "inlineImage rightFloat"
+ Just others → error ("unknown \"float\" attribute: " ⊕ T.unpack others)
+ result = case link of
+ Nothing → Span [("class", classAttr)] [Image (Right name) alt]
+ Just x → Anchor [ ("class", classAttr)
+ , ("href" , x ) ] [Image (Right name) alt]
+ return result