diff options
author | Mathieu Boespflug <m@tweag.io> | 2020-06-14 19:45:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-14 10:45:19 -0700 |
commit | 89bbe76ace7705e6e7f3817de0e09972fc3be435 (patch) | |
tree | 33ca174e64490fe526b117cc44a1bf3082d43d22 /src/Text | |
parent | 390bd51fdc0055b905c990c4db1be47bb64e055d (diff) | |
download | pandoc-89bbe76ace7705e6e7f3817de0e09972fc3be435.tar.gz |
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.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 8 |
1 files changed, 7 insertions, 1 deletions
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 |