aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Boespflug <m@tweag.io>2020-06-14 19:45:19 +0200
committerGitHub <noreply@github.com>2020-06-14 10:45:19 -0700
commit89bbe76ace7705e6e7f3817de0e09972fc3be435 (patch)
tree33ca174e64490fe526b117cc44a1bf3082d43d22 /src
parent390bd51fdc0055b905c990c4db1be47bb64e055d (diff)
downloadpandoc-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')
-rw-r--r--src/Text/Pandoc/Readers/DocBook.hs8
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