From 7a70a46c0319f279fdee3926abff08922be2f02c Mon Sep 17 00:00:00 2001 From: Rowan Rodrik van der Molen Date: Fri, 5 Nov 2021 17:22:38 +0000 Subject: Support for s when reading DocBook (#7607) * Support for s when reading DocBook * Update implementation status of `` tags * Remove non-idiomatic parentheses * More complete `` support, with tests Co-authored-by: Rowan Rodrik van der Molen --- test/docbook-reader.docbook | 12 +++ test/docbook-reader.native | 187 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 199 insertions(+) (limited to 'test') diff --git a/test/docbook-reader.docbook b/test/docbook-reader.docbook index c38abda82..00bd84649 100644 --- a/test/docbook-reader.docbook +++ b/test/docbook-reader.docbook @@ -1603,4 +1603,16 @@ or here: <http://example.com/> + + Index terms + + In the simplest case, index termsindex term consists of just a <primary> element, but index termmulti-level they can also consist of a <primary> and <secondary> element, and index termmulti-level3-level can even include a <tertiary> term. + + + Index terms can also refer to other index terms: index cross referencingindex termcross referencesindex cross referencingexclusively, using the <see> tag; or index cross referencingcross referencing as a reference to related terms, using the <seealso> tag. + + + foodbig baguette supremeNested content in index term elements is flattened. + + diff --git a/test/docbook-reader.native b/test/docbook-reader.native index be3819336..7520068b1 100644 --- a/test/docbook-reader.native +++ b/test/docbook-reader.native @@ -2930,4 +2930,191 @@ Pandoc [ Str "A" , Space , Str "Final" , Space , Str "Step" ] ] ] + , Header + 1 + ( "indexterms" , [] , [] ) + [ Str "Index" , Space , Str "terms" ] + , Para + [ Str "In" + , Space + , Str "the" + , Space + , Str "simplest" + , Space + , Str "case," + , Space + , Str "index" + , Space + , Str "terms" + , Span + ( "" , [ "indexterm" ] , [ ( "primary" , "index term" ) ] ) + [] + , Space + , Str "consists" + , Space + , Str "of" + , Space + , Str "just" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "element," + , Space + , Str "but" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index term" ) + , ( "secondary" , "multi-level" ) + ] + ) + [] + , Space + , Str "they" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "consist" + , Space + , Str "of" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "and" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "element," + , Space + , Str "and" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index term" ) + , ( "secondary" , "multi-level" ) + , ( "tertiary" , "3-level" ) + ] + ) + [] + , Space + , Str "can" + , Space + , Str "even" + , Space + , Str "include" + , Space + , Str "a" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "term." + ] + , Para + [ Str "Index" + , Space + , Str "terms" + , Space + , Str "can" + , Space + , Str "also" + , Space + , Str "refer" + , Space + , Str "to" + , Space + , Str "other" + , Space + , Str "index" + , Space + , Str "terms:" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index cross referencing" ) ] + ) + [] + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index term" ) + , ( "secondary" , "cross references" ) + , ( "see" , "index cross referencing" ) + ] + ) + [] + , Str "exclusively," + , Space + , Str "using" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "tag;" + , Space + , Str "or" + , Space + , Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "index cross referencing" ) + , ( "seealso" , "cross referencing" ) + ] + ) + [] + , Space + , Str "as" + , Space + , Str "a" + , Space + , Str "reference" + , Space + , Str "to" + , Space + , Str "related" + , Space + , Str "terms," + , Space + , Str "using" + , Space + , Str "the" + , Space + , Code ( "" , [] , [] ) "" + , Space + , Str "tag." + ] + , Para + [ Span + ( "" + , [ "indexterm" ] + , [ ( "primary" , "food" ) + , ( "secondary" , "big baguette supreme" ) + ] + ) + [] + , Str "Nested" + , Space + , Str "content" + , Space + , Str "in" + , Space + , Str "index" + , Space + , Str "term" + , Space + , Str "elements" + , Space + , Str "is" + , Space + , Str "flattened." + ] ] -- cgit v1.2.3