aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Definition.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc/Definition.hs')
-rw-r--r--src/Text/Pandoc/Definition.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Definition.hs b/src/Text/Pandoc/Definition.hs
index fffca3b2e..bec216b5d 100644
--- a/src/Text/Pandoc/Definition.hs
+++ b/src/Text/Pandoc/Definition.hs
@@ -112,7 +112,7 @@ data Inline
| Subscript [Inline] -- ^ Subscripted text (list of inlines)
| SmallCaps [Inline] -- ^ Small caps text (list of inlines)
| Quoted QuoteType [Inline] -- ^ Quoted text (list of inlines)
- | Cite [Target] [Inline] -- ^ Citation (list of inlines)
+ | Cite [Citation] [Inline] -- ^ Citation (list of inlines)
| Code String -- ^ Inline code (literal)
| Space -- ^ Inter-word space
| EmDash -- ^ Em dash
@@ -129,6 +129,20 @@ data Inline
| Note [Block] -- ^ Footnote or endnote
deriving (Show, Eq, Ord, Read, Typeable, Data)
+data Citation = Citation { citationId :: String
+ , citationPrefix :: String
+ , citationLocator :: String
+ , citationNoteNum :: Int
+ , citationAutOnly :: Bool
+ , citationNoAut :: Bool
+ , citationHash :: Int
+ }
+ deriving (Show, Ord, Read, Typeable, Data)
+
+instance Eq Citation where
+ (==) (Citation _ _ _ _ _ _ ha)
+ (Citation _ _ _ _ _ _ hb) = ha == hb
+
-- | Applies a transformation on @a@s to matching elements in a @b@.
processWith :: (Data a, Data b) => (a -> a) -> b -> b
processWith f = everywhere (mkT f)