git.iko.soy/typeable/pandoc
on master help sign in
Docbook reader: implement <phrase> (#6438)

A `<phrase>` has no semantic meaning. It is only useful to hang an `id` or other attributes around a piece of text.

commit89bbe76ace7705e6e7f3817de0e09972fc3be435 authorMathieu Boespflug <m@tweag.io> dateSun 14 Jun 2020, 19:45 (6 years ago) parent390bd51
1 file changed+7−1
src/Text/Pandoc/Readers/DocBook.hs+7−1
src/Text/Pandoc/Readers/DocBook.hs+7−1
@@ -305,7 +305,7 @@ List of all DocBook tags, with [x] indicating implemented,
305305[ ] personblurb - A short description or note about a person
306306[ ] personname - The personal name of an individual
307307[ ] phone - A telephone number
308−[ ] phrase - A span of text
308+[x] phrase - A span of text
309309[ ] pob - A post office box in an address
310310[ ] postcode - A postal code in an address
311311[x] preface - Introductory matter preceding the first chapter of a book
@@ -956,6 +956,12 @@ parseInline (CRef ref) =
956956 return $ text $ maybe (T.toUpper $ T.pack ref) T.pack $ lookupEntity ref
957957parseInline (Elem e) =
958958 case qName (elName e) of
959+ "phrase" -> do
960+ let ident = attrValue "id" e
961+ let classes = T.words $ attrValue "class" e
962+ if ident /= "" || classes /= []
963+ then spanWith (ident,classes,[]) <$> innerInlines
964+ else innerInlines
959965 "equation" -> equation e displayMath
960966 "informalequation" -> equation e displayMath
961967 "inlineequation" -> equation e math