From 89bbe76ace7705e6e7f3817de0e09972fc3be435 Mon Sep 17 00:00:00 2001 From: Mathieu Boespflug Date: Sun, 14 Jun 2020 19:45:19 +0200 Subject: Docbook reader: implement (#6438) A `` has no semantic meaning. It is only useful to hang an `id` or other attributes around a piece of text. --- src/Text/Pandoc/Readers/DocBook.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 06c6ef870..28e93c63c 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -305,7 +305,7 @@ List of all DocBook tags, with [x] indicating implemented, [ ] personblurb - A short description or note about a person [ ] personname - The personal name of an individual [ ] phone - A telephone number -[ ] phrase - A span of text +[x] phrase - A span of text [ ] pob - A post office box in an address [ ] postcode - A postal code in an address [x] preface - Introductory matter preceding the first chapter of a book @@ -956,6 +956,12 @@ parseInline (CRef ref) = return $ text $ maybe (T.toUpper $ T.pack ref) T.pack $ lookupEntity ref parseInline (Elem e) = case qName (elName e) of + "phrase" -> do + let ident = attrValue "id" e + let classes = T.words $ attrValue "class" e + if ident /= "" || classes /= [] + then spanWith (ident,classes,[]) <$> innerInlines + else innerInlines "equation" -> equation e displayMath "informalequation" -> equation e displayMath "inlineequation" -> equation e math -- cgit v1.2.3