"Fossies" - the Fresh Open Source Software Archive

Member "asciidoctor-2.0.10/features/xref.feature" (1 Jun 2019, 25269 Bytes) of package /linux/www/asciidoctor-2.0.10.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 # language: en
    2 Feature: Cross References
    3   In order to create cross references between sections and blocks in the current or neighboring document
    4   As a writer
    5   I want to be able to use the cross reference macro to compose these references
    6 
    7   Scenario: Create a cross reference to a block that has explicit reftext
    8   Given the AsciiDoc source
    9     """
   10     :xrefstyle: full
   11 
   12     See <<param-type-t>> to learn how it works.
   13 
   14     .Parameterized Type <T>
   15     [[param-type-t,that "<T>" thing]]
   16     ****
   17     This sidebar describes what that <T> thing is all about.
   18     ****
   19     """
   20   When it is converted to html
   21   Then the result should contain the HTML structure
   22     """
   23     |See
   24     a<> href='#param-type-t' that "&lt;T&gt;" thing
   25     |to learn how it works.
   26     """
   27   When it is converted to docbook
   28   Then the result should match the XML structure
   29     """
   30     simpara
   31       |See
   32       xref<> linkend='param-type-t'/
   33       |to learn how it works.
   34     sidebar xml:id='param-type-t' xreflabel='that &quot;&lt;T&gt;&quot; thing'
   35       title Parameterized Type &lt;T&gt;
   36       simpara This sidebar describes what that &lt;T&gt; thing is all about.
   37     """
   38 
   39   Scenario: Create a cross reference to a block that has explicit reftext with formatting
   40   Given the AsciiDoc source
   41     """
   42     :xrefstyle: full
   43 
   44     There are cats, then there are the <<big-cats>>.
   45 
   46     [[big-cats,*big* cats]]
   47     == Big Cats
   48 
   49     So ferocious.
   50     """
   51   When it is converted to html
   52   Then the result should contain the HTML structure
   53     """
   54     |There are cats, then there are the
   55     a< href='#big-cats' <strong>big</strong> cats
   56     |.
   57     """
   58   When it is converted to docbook
   59   Then the result should match the XML structure
   60     """
   61     simpara
   62       |There are cats, then there are the
   63       xref< linkend='big-cats'/
   64       |.
   65     section xml:id='big-cats' xreflabel='big cats'
   66       title Big Cats
   67       simpara So ferocious.
   68     """
   69 
   70   Scenario: Create a full cross reference to a numbered section
   71   Given the AsciiDoc source
   72     """
   73     :sectnums:
   74     :xrefstyle: full
   75 
   76     See <<sect-features>> to find a complete list of features.
   77 
   78     == About
   79 
   80     [#sect-features]
   81     === Features
   82 
   83     All the features are listed in this section.
   84     """
   85   When it is converted to html
   86   Then the result should contain the HTML structure
   87     """
   88     |See
   89     a<> href='#sect-features' Section 1.1, &#8220;Features&#8221;
   90     |to find a complete list of features.
   91     """
   92 
   93   Scenario: Create a short cross reference to a numbered section
   94   Given the AsciiDoc source
   95     """
   96     :sectnums:
   97     :xrefstyle: short
   98 
   99     See <<sect-features>> to find a complete list of features.
  100 
  101     [#sect-features]
  102     == Features
  103 
  104     All the features are listed in this section.
  105     """
  106   When it is converted to html
  107   Then the result should contain the HTML structure
  108     """
  109     |See
  110     a<> href='#sect-features' Section 1
  111     |to find a complete list of features.
  112     """
  113 
  114   Scenario: Create a basic cross reference to an unnumbered section
  115   Given the AsciiDoc source
  116     """
  117     :xrefstyle: full
  118 
  119     See <<sect-features>> to find a complete list of features.
  120 
  121     [#sect-features]
  122     == Features
  123 
  124     All the features are listed in this section.
  125     """
  126   When it is converted to html
  127   Then the result should contain the HTML structure
  128     """
  129     |See
  130     a<> href='#sect-features' Features
  131     |to find a complete list of features.
  132     """
  133 
  134   Scenario: Create a basic cross reference to a numbered section when the section reference signifier is disabled
  135   Given the AsciiDoc source
  136     """
  137     :sectnums:
  138     :xrefstyle: full
  139     :!section-refsig:
  140 
  141     See <<sect-features>> to find a complete list of features.
  142 
  143     [#sect-features]
  144     == Features
  145 
  146     All the features are listed in this section.
  147     """
  148   When it is converted to html
  149   Then the result should contain the HTML structure
  150     """
  151     |See
  152     a<> href='#sect-features' 1, &#8220;Features&#8221;
  153     |to find a complete list of features.
  154     """
  155 
  156   Scenario: Create a full cross reference to a numbered chapter
  157   Given the AsciiDoc source
  158     """
  159     :doctype: book
  160     :sectnums:
  161     :xrefstyle: full
  162 
  163     See <<chap-features>> to find a complete list of features.
  164 
  165     [#chap-features]
  166     == Features
  167 
  168     All the features are listed in this chapter.
  169     """
  170   When it is converted to html
  171   Then the result should contain the HTML structure
  172     """
  173     |See
  174     a<> href='#chap-features' Chapter 1, <em>Features</em>
  175     |to find a complete list of features.
  176     """
  177 
  178   Scenario: Create a short cross reference to a numbered chapter
  179   Given the AsciiDoc source
  180     """
  181     :doctype: book
  182     :sectnums:
  183     :xrefstyle: short
  184 
  185     See <<chap-features>> to find a complete list of features.
  186 
  187     [#chap-features]
  188     == Features
  189 
  190     All the features are listed in this chapter.
  191     """
  192   When it is converted to html
  193   Then the result should contain the HTML structure
  194     """
  195     |See
  196     a<> href='#chap-features' Chapter 1
  197     |to find a complete list of features.
  198     """
  199 
  200   Scenario: Create a basic cross reference to a numbered chapter
  201   Given the AsciiDoc source
  202     """
  203     :doctype: book
  204     :sectnums:
  205     :xrefstyle: basic
  206 
  207     See <<chap-features>> to find a complete list of features.
  208 
  209     [#chap-features]
  210     == Features
  211 
  212     All the features are listed in this chapter.
  213     """
  214   When it is converted to html
  215   Then the result should contain the HTML structure
  216     """
  217     |See
  218     a<> href='#chap-features' <em>Features</em>
  219     |to find a complete list of features.
  220     """
  221 
  222   Scenario: Create a basic cross reference to an unnumbered chapter
  223   Given the AsciiDoc source
  224     """
  225     :doctype: book
  226     :xrefstyle: full
  227 
  228     See <<chap-features>> to find a complete list of features.
  229 
  230     [#chap-features]
  231     == Features
  232 
  233     All the features are listed in this chapter.
  234     """
  235   When it is converted to html
  236   Then the result should contain the HTML structure
  237     """
  238     |See
  239     a<> href='#chap-features' <em>Features</em>
  240     |to find a complete list of features.
  241     """
  242 
  243   Scenario: Create a cross reference to a chapter using a custom chapter reference signifier
  244   Given the AsciiDoc source
  245     """
  246     :doctype: book
  247     :sectnums:
  248     :xrefstyle: full
  249     :chapter-refsig: Ch
  250 
  251     See <<chap-features>> to find a complete list of features.
  252 
  253     [#chap-features]
  254     == Features
  255 
  256     All the features are listed in this chapter.
  257     """
  258   When it is converted to html
  259   Then the result should contain the HTML structure
  260     """
  261     |See
  262     a<> href='#chap-features' Ch 1, <em>Features</em>
  263     |to find a complete list of features.
  264     """
  265 
  266   Scenario: Create a full cross reference to a numbered part
  267   Given the AsciiDoc source
  268     """
  269     :doctype: book
  270     :sectnums:
  271     :partnums:
  272     :xrefstyle: full
  273 
  274     [preface]
  275     = Preface
  276 
  277     See <<p1>> for an introduction to the language.
  278 
  279     [#p1]
  280     = Language
  281 
  282     == Syntax
  283 
  284     This chapter covers the syntax.
  285     """
  286   When it is converted to html
  287   Then the result should contain the HTML structure
  288     """
  289     |See
  290     a<> href='#p1' Part I, &#8220;Language&#8221;
  291     |for an introduction to the language.
  292     """
  293 
  294   Scenario: Create a short cross reference to a numbered part
  295   Given the AsciiDoc source
  296     """
  297     :doctype: book
  298     :sectnums:
  299     :partnums:
  300     :xrefstyle: short
  301 
  302     [preface]
  303     = Preface
  304 
  305     See <<p1>> for an introduction to the language.
  306 
  307     [#p1]
  308     = Language
  309 
  310     == Syntax
  311 
  312     This chapter covers the syntax.
  313     """
  314   When it is converted to html
  315   Then the result should contain the HTML structure
  316     """
  317     |See
  318     a<> href='#p1' Part I
  319     |for an introduction to the language.
  320     """
  321 
  322   Scenario: Create a basic cross reference to a numbered part
  323   Given the AsciiDoc source
  324     """
  325     :doctype: book
  326     :sectnums:
  327     :partnums:
  328     :xrefstyle: basic
  329 
  330     [preface]
  331     = Preface
  332 
  333     See <<p1>> for an introduction to the language.
  334 
  335     [#p1]
  336     = Language
  337 
  338     == Syntax
  339 
  340     This chapter covers the syntax.
  341     """
  342   When it is converted to html
  343   Then the result should contain the HTML structure
  344     """
  345     |See
  346     a<> href='#p1' Language
  347     |for an introduction to the language.
  348     """
  349 
  350   Scenario: Create a basic cross reference to an unnumbered part
  351   Given the AsciiDoc source
  352     """
  353     :doctype: book
  354     :sectnums:
  355     :xrefstyle: full
  356 
  357     [preface]
  358     = Preface
  359 
  360     See <<p1>> for an introduction to the language.
  361 
  362     [#p1]
  363     = Language
  364 
  365     == Syntax
  366 
  367     This chapter covers the syntax.
  368     """
  369   When it is converted to html
  370   Then the result should contain the HTML structure
  371     """
  372     |See
  373     a<> href='#p1' Language
  374     |for an introduction to the language.
  375     """
  376 
  377   @wip
  378   Scenario: Create a cross reference to a part using a custom part reference signifier
  379   Given the AsciiDoc source
  380     """
  381     :doctype: book
  382     :sectnums:
  383     :partnums:
  384     :xrefstyle: full
  385     :part-refsig: P
  386 
  387     [preface]
  388     = Preface
  389 
  390     See <<p1>> for an introduction to the language.
  391 
  392     [#p1]
  393     = Language
  394 
  395     == Syntax
  396 
  397     This chapter covers the syntax.
  398     """
  399   When it is converted to html
  400   Then the result should contain the HTML structure
  401     """
  402     |See
  403     a<> href='#p1' P I, &#8220;Language&#8221;
  404     |for an introduction to the language.
  405     """
  406 
  407   Scenario: Create a full cross reference to a numbered appendix
  408   Given the AsciiDoc source
  409     """
  410     :sectnums:
  411     :xrefstyle: full
  412 
  413     See <<app-features>> to find a complete list of features.
  414 
  415     [appendix#app-features]
  416     == Features
  417 
  418     All the features are listed in this appendix.
  419     """
  420   When it is converted to html
  421   Then the result should contain the HTML structure
  422     """
  423     |See
  424     a<> href='#app-features' Appendix A, <em>Features</em>
  425     |to find a complete list of features.
  426     """
  427 
  428   Scenario: Create a short cross reference to a numbered appendix
  429   Given the AsciiDoc source
  430     """
  431     :sectnums:
  432     :xrefstyle: short
  433 
  434     See <<app-features>> to find a complete list of features.
  435 
  436     [appendix#app-features]
  437     == Features
  438 
  439     All the features are listed in this appendix.
  440     """
  441   When it is converted to html
  442   Then the result should contain the HTML structure
  443     """
  444     |See
  445     a<> href='#app-features' Appendix A
  446     |to find a complete list of features.
  447     """
  448 
  449   Scenario: Create a full cross reference to an appendix even when section numbering is disabled
  450   Given the AsciiDoc source
  451     """
  452     :xrefstyle: full
  453 
  454     See <<app-features>> to find a complete list of features.
  455 
  456     [appendix#app-features]
  457     == Features
  458 
  459     All the features are listed in this appendix.
  460     """
  461   When it is converted to html
  462   Then the result should contain the HTML structure
  463     """
  464     |See
  465     a<> href='#app-features' Appendix A, <em>Features</em>
  466     |to find a complete list of features.
  467     """
  468 
  469   Scenario: Create a full cross reference to a numbered formal block
  470   Given the AsciiDoc source
  471     """
  472     :xrefstyle: full
  473 
  474     See <<tbl-features>> to find a table of features.
  475 
  476     .Features
  477     [#tbl-features%autowidth]
  478     |===
  479     |Text formatting |Formats text for display.
  480     |===
  481     """
  482   When it is converted to html
  483   Then the result should contain the HTML structure
  484     """
  485     |See
  486     a<> href='#tbl-features' Table 1, &#8220;Features&#8221;
  487     |to find a table of features.
  488     """
  489 
  490   Scenario: Create a short cross reference to a numbered formal block
  491   Given the AsciiDoc source
  492     """
  493     :xrefstyle: short
  494 
  495     See <<tbl-features>> to find a table of features.
  496 
  497     .Features
  498     [#tbl-features%autowidth]
  499     |===
  500     |Text formatting |Formats text for display.
  501     |===
  502     """
  503   When it is converted to html
  504   Then the result should contain the HTML structure
  505     """
  506     |See
  507     a<> href='#tbl-features' Table 1
  508     |to find a table of features.
  509     """
  510 
  511   Scenario: Create a basic cross reference to a numbered formal block when the caption prefix is disabled
  512   Given the AsciiDoc source
  513     """
  514     :xrefstyle: full
  515     :!table-caption:
  516 
  517     See <<tbl-features>> to find a table of features.
  518 
  519     .Features
  520     [#tbl-features%autowidth]
  521     |===
  522     |Text formatting |Formats text for display.
  523     |===
  524     """
  525   When it is converted to html
  526   Then the result should contain the HTML structure
  527     """
  528     |See
  529     a<> href='#tbl-features' Features
  530     |to find a table of features.
  531     """
  532 
  533   Scenario: Create a cross reference to a numbered formal block with a custom caption prefix
  534   Given the AsciiDoc source
  535     """
  536     :xrefstyle: full
  537     :table-caption: Tbl
  538 
  539     See <<tbl-features>> to find a table of features.
  540 
  541     .Features
  542     [#tbl-features%autowidth]
  543     |===
  544     |Text formatting |Formats text for display.
  545     |===
  546     """
  547   When it is converted to html
  548   Then the result should contain the HTML structure
  549     """
  550     |See
  551     a<> href='#tbl-features' Tbl 1, &#8220;Features&#8221;
  552     |to find a table of features.
  553     """
  554 
  555   Scenario: Create a full cross reference to a formal image block
  556   Given the AsciiDoc source
  557     """
  558     :xrefstyle: full
  559 
  560     Behold, <<tiger>>!
  561 
  562     .The ferocious Ghostscript tiger
  563     [#tiger]
  564     image::tiger.svg[Ghostscript tiger]
  565     """
  566   When it is converted to html
  567   Then the result should match the HTML structure
  568     """
  569     .paragraph: p
  570       |Behold,
  571       a< href='#tiger' Figure 1, &#8220;The ferocious Ghostscript tiger&#8221;
  572       |!
  573     #tiger.imageblock
  574       .content: img src='tiger.svg' alt='Ghostscript tiger'
  575       .title Figure 1. The ferocious Ghostscript tiger
  576     """
  577 
  578   Scenario: Create a short cross reference to a formal image block
  579   Given the AsciiDoc source
  580     """
  581     :xrefstyle: short
  582 
  583     Behold, <<tiger>>!
  584 
  585     .The ferocious Ghostscript tiger
  586     [#tiger]
  587     image::tiger.svg[Ghostscript tiger]
  588     """
  589   When it is converted to html
  590   Then the result should match the HTML structure
  591     """
  592     .paragraph: p
  593       |Behold,
  594       a< href='#tiger' Figure 1
  595       |!
  596     #tiger.imageblock
  597       .content: img src='tiger.svg' alt='Ghostscript tiger'
  598       .title Figure 1. The ferocious Ghostscript tiger
  599     """
  600 
  601   Scenario: Create a full cross reference to a block with an explicit caption
  602   Given the AsciiDoc source
  603     """
  604     :xrefstyle: full
  605 
  606     See <<diagram-1>> and <<diagram-2>>.
  607 
  608     .Managing Orders
  609     [#diagram-1,caption="Diagram {counter:diag-number}. "]
  610     image::managing-orders.png[Managing Orders]
  611 
  612     .Managing Inventory
  613     [#diagram-2,caption="Diagram {counter:diag-number}. "]
  614     image::managing-inventory.png[Managing Inventory]
  615     """
  616   When it is converted to html
  617   Then the result should match the HTML structure
  618     """
  619     .paragraph: p
  620       |See
  621       a<> href='#diagram-1' Diagram 1, &#8220;Managing Orders&#8221;
  622       |and
  623       a< href='#diagram-2' Diagram 2, &#8220;Managing Inventory&#8221;
  624       |.
  625     #diagram-1.imageblock
  626       .content: img src='managing-orders.png' alt='Managing Orders'
  627       .title Diagram 1. Managing Orders
  628     #diagram-2.imageblock
  629       .content: img src='managing-inventory.png' alt='Managing Inventory'
  630       .title Diagram 2. Managing Inventory
  631     """
  632 
  633   Scenario: Create a short cross reference to a block with an explicit caption
  634   Given the AsciiDoc source
  635     """
  636     :xrefstyle: short
  637 
  638     See <<diagram-1>> and <<diagram-2>>.
  639 
  640     .Managing Orders
  641     [#diagram-1,caption="Diagram {counter:diag-number}. "]
  642     image::managing-orders.png[Managing Orders]
  643 
  644     .Managing Inventory
  645     [#diagram-2,caption="Diagram {counter:diag-number}. "]
  646     image::managing-inventory.png[Managing Inventory]
  647     """
  648   When it is converted to html
  649   Then the result should match the HTML structure
  650     """
  651     .paragraph: p
  652       |See
  653       a<> href='#diagram-1' Diagram 1
  654       |and
  655       a< href='#diagram-2' Diagram 2
  656       |.
  657     #diagram-1.imageblock
  658       .content: img src='managing-orders.png' alt='Managing Orders'
  659       .title Diagram 1. Managing Orders
  660     #diagram-2.imageblock
  661       .content: img src='managing-inventory.png' alt='Managing Inventory'
  662       .title Diagram 2. Managing Inventory
  663     """
  664 
  665   Scenario: Create a basic cross reference to an unnumbered formal block
  666   Given the AsciiDoc source
  667     """
  668     :xrefstyle: full
  669 
  670     See <<data>> to find the data used in this report.
  671 
  672     .Data
  673     [#data]
  674     ....
  675     a
  676     b
  677     c
  678     ....
  679     """
  680   When it is converted to html
  681   Then the result should contain the HTML structure
  682     """
  683     |See
  684     a<> href='#data' Data
  685     |to find the data used in this report.
  686     """
  687 
  688   Scenario: Use title as cross reference text to refer to a formal admonition block
  689   Given the AsciiDoc source
  690     """
  691     :xrefstyle: full
  692 
  693     Recall in <<essential-tip-1>>, we told you how to speed up this process.
  694 
  695     .Essential tip #1
  696     [#essential-tip-1]
  697     TIP: You can speed up this process by pressing the turbo button.
  698     """
  699   When it is converted to html
  700   Then the result should contain the HTML structure
  701     """
  702     |Recall in
  703     a< href='#essential-tip-1' Essential tip #1
  704     |, we told you how to speed up this process.
  705     """
  706 
  707   Scenario: Create a cross reference from an AsciiDoc cell to a section
  708   Given the AsciiDoc source
  709     """
  710     |===
  711     a|See <<_install>>
  712     |===
  713 
  714     == Install
  715 
  716     Instructions go here.
  717     """
  718   When it is converted to html
  719   Then the result should match the HTML structure
  720     """
  721     table.tableblock.frame-all.grid-all.stretch
  722       colgroup
  723         col style='width: 100%;'
  724       tbody
  725         tr
  726           td.tableblock.halign-left.valign-top
  727             div.content
  728               .paragraph: p
  729                 |See
  730                 a< href='#_install' Install
  731     .sect1
  732       h2#_install Install
  733       .sectionbody
  734         .paragraph: p Instructions go here.
  735     """
  736 
  737     Scenario: Create a cross reference using the title of the target section
  738     Given the AsciiDoc source
  739       """
  740       == Section One
  741 
  742       content
  743 
  744       == Section Two, continued from <<Section One>>
  745 
  746       refer to <<Section One>>
  747       """
  748     When it is converted to html
  749     Then the result should match the HTML structure
  750       """
  751       .sect1
  752         h2#_section_one Section One
  753         .sectionbody: .paragraph: p content
  754       .sect1
  755         h2#_section_two_continued_from_section_one
  756           |Section Two, continued from
  757           a< href='#_section_one' Section One
  758         .sectionbody: .paragraph: p
  759           |refer to
  760           a< href='#_section_one' Section One
  761       """
  762 
  763     Scenario: Create a cross reference using the reftext of the target section
  764     Given the AsciiDoc source
  765       """
  766       [reftext="the first section"]
  767       == Section One
  768 
  769       content
  770 
  771       == Section Two
  772 
  773       refer to <<the first section>>
  774       """
  775     When it is converted to html
  776     Then the result should match the HTML structure
  777       """
  778       .sect1
  779         h2#_section_one Section One
  780         .sectionbody: .paragraph: p content
  781       .sect1
  782         h2#_section_two Section Two
  783         .sectionbody: .paragraph: p
  784           |refer to
  785           a< href='#_section_one' the first section
  786       """
  787     When it is converted to docbook
  788     Then the result should match the XML structure
  789       """
  790       section xml:id='_section_one' xreflabel='the first section'
  791         title Section One
  792         simpara content
  793       section xml:id='_section_two'
  794         title Section Two
  795         simpara
  796           |refer to
  797           xref< linkend='_section_one'/
  798       """
  799 
  800     Scenario: Create a cross reference using the formatted title of the target section
  801     Given the AsciiDoc source
  802       """
  803       == Section *One*
  804 
  805       content
  806 
  807       == Section Two
  808 
  809       refer to <<Section *One*>>
  810       """
  811     When it is converted to html
  812     Then the result should match the HTML structure
  813       """
  814       .sect1
  815         h2#_section_one
  816           |Section <strong>One</strong>
  817         .sectionbody: .paragraph: p content
  818       .sect1
  819         h2#_section_two Section Two
  820         .sectionbody: .paragraph: p
  821           |refer to
  822           a< href='#_section_one' Section <strong>One</strong>
  823       """
  824 
  825     Scenario: Does not process a natural cross reference in compat mode
  826     Given the AsciiDoc source
  827       """
  828       :compat-mode:
  829 
  830       == Section One
  831 
  832       content
  833 
  834       == Section Two
  835 
  836       refer to <<Section One>>
  837       """
  838     When it is converted to html
  839     Then the result should match the HTML structure
  840       """
  841       .sect1
  842         h2#_section_one
  843           |Section One
  844         .sectionbody: .paragraph: p content
  845       .sect1
  846         h2#_section_two Section Two
  847         .sectionbody: .paragraph: p
  848           |refer to
  849           a< href='#Section One' [Section One]
  850       """
  851 
  852     Scenario: Parses text of xref macro as attributes if attribute signature found
  853     Given the AsciiDoc source
  854       """
  855       == Section One
  856 
  857       content
  858 
  859       == Section Two
  860 
  861       refer to xref:_section_one[role=next]
  862       """
  863     When it is converted to html
  864     Then the result should match the HTML structure
  865       """
  866       .sect1
  867         h2#_section_one
  868           |Section One
  869         .sectionbody: .paragraph: p content
  870       .sect1
  871         h2#_section_two Section Two
  872         .sectionbody: .paragraph: p
  873           |refer to
  874           a< href='#_section_one' class='next' Section One
  875       """
  876 
  877     Scenario: Does not parse text of xref macro as attribute if attribute signature not found
  878     Given the AsciiDoc source
  879       """
  880       == Section One
  881 
  882       content
  883 
  884       == Section Two
  885 
  886       refer to xref:_section_one[One, Section One]
  887       """
  888     When it is converted to html
  889     Then the result should match the HTML structure
  890       """
  891       .sect1
  892         h2#_section_one
  893           |Section One
  894         .sectionbody: .paragraph: p content
  895       .sect1
  896         h2#_section_two Section Two
  897         .sectionbody: .paragraph: p
  898           |refer to
  899           a< href='#_section_one' One, Section One
  900       """
  901 
  902     Scenario: Uses whole text of xref macro as link text if attribute signature found and text is enclosed in double quotes
  903     Given the AsciiDoc source
  904       """
  905       == Section One
  906 
  907       content
  908 
  909       == Section Two
  910 
  911       refer to xref:_section_one["Section One == Starting Point"]
  912       """
  913     When it is converted to html
  914     Then the result should match the HTML structure
  915       """
  916       .sect1
  917         h2#_section_one
  918           |Section One
  919         .sectionbody: .paragraph: p content
  920       .sect1
  921         h2#_section_two Section Two
  922         .sectionbody: .paragraph: p
  923           |refer to
  924           a< href='#_section_one'
  925             |Section One == Starting Point
  926       """
  927 
  928     Scenario: Does not parse text of xref macro as text if enclosed in double quotes but attribute signature not found
  929     Given the AsciiDoc source
  930       """
  931       == Section One
  932 
  933       content
  934 
  935       == Section Two
  936 
  937       refer to xref:_section_one["The Premier Section"]
  938       """
  939     When it is converted to html
  940     Then the result should match the HTML structure
  941       """
  942       .sect1
  943         h2#_section_one
  944           |Section One
  945         .sectionbody: .paragraph: p content
  946       .sect1
  947         h2#_section_two Section Two
  948         .sectionbody: .paragraph: p
  949           |refer to
  950           a< href='#_section_one' "The Premier Section"
  951       """
  952 
  953     Scenario: Can escape double quotes in text of xref macro using backslashes when text is parsed as attributes
  954     Given the AsciiDoc source
  955       """
  956       == Section One
  957 
  958       content
  959 
  960       == Section Two
  961 
  962       refer to xref:_section_one["\"The Premier Section\"",role=spotlight]
  963       """
  964     When it is converted to html
  965     Then the result should match the HTML structure
  966       """
  967       .sect1
  968         h2#_section_one
  969           |Section One
  970         .sectionbody: .paragraph: p content
  971       .sect1
  972         h2#_section_two Section Two
  973         .sectionbody: .paragraph: p
  974           |refer to
  975           a< href='#_section_one' class='spotlight' "The Premier Section"
  976       """
  977 
  978     Scenario: Override xrefstyle for a given part of the document
  979     Given the AsciiDoc source
  980       """
  981       :xrefstyle: full
  982       :doctype: book
  983       :sectnums:
  984 
  985       == Foo
  986 
  987       refer to <<#_bar>>
  988 
  989       == Bar
  990       :xrefstyle: short
  991 
  992       refer to xref:#_foo[xrefstyle=short]
  993       """
  994     When it is converted to html
  995     Then the result should match the HTML structure
  996       """
  997       .sect1
  998         h2#_foo 1. Foo
  999         .sectionbody: .paragraph: p
 1000           |refer to
 1001           a< href='#_bar' Chapter 2, <em>Bar</em>
 1002       .sect1
 1003         h2#_bar 2. Bar
 1004         .sectionbody: .paragraph: p
 1005           |refer to
 1006           a< href='#_foo' Chapter 1
 1007       """
 1008 
 1009     Scenario: Override xrefstyle for a specific reference by assigning the xrefstyle attribute on the xref macro
 1010     Given the AsciiDoc source
 1011       """
 1012       :xrefstyle: full
 1013       :doctype: book
 1014       :sectnums:
 1015 
 1016       == Foo
 1017 
 1018       content
 1019 
 1020       == Bar
 1021 
 1022       refer to <<#_foo>>
 1023 
 1024       refer to xref:#_foo[xrefstyle=short]
 1025       """
 1026     When it is converted to html
 1027     Then the result should match the HTML structure
 1028       """
 1029       .sect1
 1030         h2#_foo 1. Foo
 1031         .sectionbody: .paragraph: p content
 1032       .sect1
 1033         h2#_bar 2. Bar
 1034         .sectionbody
 1035           .paragraph: p
 1036             |refer to
 1037             a< href='#_foo' Chapter 1, <em>Foo</em>
 1038           .paragraph: p
 1039             |refer to
 1040             a< href='#_foo' Chapter 1
 1041       """