diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2024-03-19 08:09:54 -0700 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2024-03-19 08:09:54 -0700 |
| commit | ebcae86cf47e3037ccc3c7146cf610e5a7af3b03 (patch) | |
| tree | 67899c5b6a96930840cbd8ad2b20af053569c60c /src/Text/Pandoc | |
| parent | 27ee5a76967c2b9c418ecd4fe944fe4ad3890a17 (diff) | |
DocBook reader: add empty title to admonition div if not present.
This allows admonition elements (e.g. `<note>`) to work with
gfm admonitions even if the `<title>` is not present.
Closes #9569.
Diffstat (limited to 'src/Text/Pandoc')
| -rw-r--r-- | src/Text/Pandoc/Readers/DocBook.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/DocBook.hs b/src/Text/Pandoc/Readers/DocBook.hs index 7b4d1cb1b..68f55c219 100644 --- a/src/Text/Pandoc/Readers/DocBook.hs +++ b/src/Text/Pandoc/Readers/DocBook.hs @@ -1108,8 +1108,9 @@ parseBlock (Elem e) = -- the title: docbook references are ambiguous on that, and some implementations of admonitions -- (e.g. asciidoctor) just use an icon in all cases. To be conservative, we don't -- include the label and leave it to styling. - title <- case filterChild (named "title") e of - Just t -> divWith ("", ["title"], []) . plain <$> getInlines t + title <- divWith ("", ["title"], []) . plain <$> + case filterChild (named "title") e of + Just t -> getInlines t Nothing -> return mempty -- this will ignore the title element if it is present b <- getBlocks e |
