git.iko.soy/typeable/pandoc
on master help sign in
DocBook reader: Skip toc tags.
commit84d213baff79c44b0960b9b9a64b232a42abc97a authorJohn MacFarlane <fiddlosopher@gmail.com> dateThu 10 May 2012, 19:56 (14 years ago) parentdab6a36
1 file changed+12−11
src/Text/Pandoc/Readers/DocBook.hs+12−11
src/Text/Pandoc/Readers/DocBook.hs+12−11
@@ -447,23 +447,23 @@ List of all DocBook tags, with [x] indicating implemented,
447447[x] title - The text of the title of a section of a document or of a formal
448448 block-level element
449449[x] titleabbrev - The abbreviation of a Title
450−[ ] toc - A table of contents
451−[ ] tocback - An entry in a table of contents for a back matter component
452−[ ] tocchap - An entry in a table of contents for a component in the body of
450+[x] toc - A table of contents
451+[x] tocback - An entry in a table of contents for a back matter component
452+[x] tocchap - An entry in a table of contents for a component in the body of
453453 a document
454−[ ] tocentry - A component title in a table of contents
455−[ ] tocfront - An entry in a table of contents for a front matter component
456−[ ] toclevel1 - A top-level entry within a table of contents entry for a
454+[x] tocentry - A component title in a table of contents
455+[x] tocfront - An entry in a table of contents for a front matter component
456+[x] toclevel1 - A top-level entry within a table of contents entry for a
457457 chapter-like component
458−[ ] toclevel2 - A second-level entry within a table of contents entry for a
458+[x] toclevel2 - A second-level entry within a table of contents entry for a
459459 chapter-like component
460−[ ] toclevel3 - A third-level entry within a table of contents entry for a
460+[x] toclevel3 - A third-level entry within a table of contents entry for a
461461 chapter-like component
462−[ ] toclevel4 - A fourth-level entry within a table of contents entry for a
462+[x] toclevel4 - A fourth-level entry within a table of contents entry for a
463463 chapter-like component
464−[ ] toclevel5 - A fifth-level entry within a table of contents entry for a
464+[x] toclevel5 - A fifth-level entry within a table of contents entry for a
465465 chapter-like component
466−[ ] tocpart - An entry in a table of contents for a part of a book
466+[x] tocpart - An entry in a table of contents for a part of a book
467467[ ] token - A unit of information
468468[x] tr - A row in an HTML table
469469[ ] trademark - A trademark
@@ -584,6 +584,7 @@ parseBlock (Text (CData _ s _)) = if all isSpace s
584584parseBlock (CRef x) = return $ plain $ str $ map toUpper x
585585parseBlock (Elem e) =
586586 case qName (elName e) of
587+ "toc" -> return mempty -- skip TOC, since in pandoc it's autogenerated
587588 "para" -> para <$> getInlines e
588589 "simpara" -> para <$> getInlines e
589590 "ackno" -> para <$> getInlines e