Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75360 - in branches/quickbook-dev/tools/quickbook: src test
From: dnljms_at_[hidden]
Date: 2011-11-06 17:22:46


Author: danieljames
Date: 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
New Revision: 75360
URL: http://svn.boost.org/trac/boost/changeset/75360

Log:
Quickbook: Support escapes in links, anchors, images, includes, imports and exports.
Added:
   branches/quickbook-dev/tools/quickbook/test/anchor-1_6.gold (contents, props changed)
   branches/quickbook-dev/tools/quickbook/test/anchor-1_6.quickbook (contents, props changed)
   branches/quickbook-dev/tools/quickbook/test/escape-1_6.gold
      - copied, changed from r75359, /branches/quickbook-dev/tools/quickbook/test/escape-1_1.gold
   branches/quickbook-dev/tools/quickbook/test/escape-1_6.quickbook
      - copied, changed from r75359, /branches/quickbook-dev/tools/quickbook/test/escape-1_1.quickbook
   branches/quickbook-dev/tools/quickbook/test/image-1_6.gold (contents, props changed)
   branches/quickbook-dev/tools/quickbook/test/image-1_6.quickbook (contents, props changed)
   branches/quickbook-dev/tools/quickbook/test/link-1_6.gold (contents, props changed)
   branches/quickbook-dev/tools/quickbook/test/link-1_6.quickbook (contents, props changed)
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/actions.cpp | 57 +++++++++++++++++++++++++++------------
   branches/quickbook-dev/tools/quickbook/src/actions.hpp | 4 +-
   branches/quickbook-dev/tools/quickbook/src/actions_class.cpp | 2
   branches/quickbook-dev/tools/quickbook/src/actions_class.hpp | 2
   branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp | 20 +++++++++++--
   branches/quickbook-dev/tools/quickbook/src/grammar_impl.hpp | 1
   branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp | 17 +++++++++++
   branches/quickbook-dev/tools/quickbook/src/phrase_element_grammar.cpp | 52 +++++++++++++++++++++++++++++++----
   branches/quickbook-dev/tools/quickbook/src/utils.cpp | 5 ---
   branches/quickbook-dev/tools/quickbook/src/utils.hpp | 1
   branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 | 4 ++
   branches/quickbook-dev/tools/quickbook/test/escape-1_1.gold | 3 ++
   branches/quickbook-dev/tools/quickbook/test/escape-1_1.quickbook | 3 ++
   branches/quickbook-dev/tools/quickbook/test/escape-1_6.gold | 5 ++
   branches/quickbook-dev/tools/quickbook/test/escape-1_6.quickbook | 4 ++
   15 files changed, 139 insertions(+), 41 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/actions.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.cpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -579,7 +579,11 @@
     void anchor_action(quickbook::actions& actions, value anchor)
     {
         value_consumer values = anchor;
- add_anchor(actions, values.consume().get_quickbook());
+ value anchor_id = values.consume();
+ // Note: anchor_id is never encoded as boostbook. If it
+ // is encoded, it's just things like escapes.
+ add_anchor(actions, anchor_id.is_encoded() ?
+ anchor_id.get_boostbook() : anchor_id.get_quickbook());
         values.finish();
     }
 
@@ -605,15 +609,15 @@
         }
     }
 
- void space_action::operator()(char ch) const
+ void raw_char_action::operator()(char ch) const
     {
- detail::print_space(ch, out.get());
+ out << ch;
     }
 
- void space_action::operator()(parse_iterator first, parse_iterator last) const
+ void raw_char_action::operator()(parse_iterator first, parse_iterator last) const
     {
         while (first != last)
- detail::print_space(*first++, out.get());
+ out << *first++;
     }
 
     void source_mode_action(quickbook::actions& actions, value source_mode)
@@ -719,6 +723,8 @@
     {
         write_anchors(actions, actions.phrase);
 
+ // Note: attributes are never encoded as boostbook, if they're
+ // encoded, it's just things like escapes.
         typedef std::map<std::string, value> attribute_map;
         attribute_map attributes;
 
@@ -747,7 +753,9 @@
         // Not using Boost.Filesystem because I want to stay in UTF-8.
         // Need to think about uri encoding.
         
- std::string fileref = attributes["fileref"].get_quickbook();
+ std::string fileref = attributes["fileref"].is_encoded() ?
+ attributes["fileref"].get_boostbook() :
+ attributes["fileref"].get_quickbook();
 
         // Check for windows paths, then convert.
         // A bit crude, but there you go.
@@ -772,7 +780,7 @@
         // Need to think about uri encoding.
 
         std::string::size_type pos;
- std::string stem,extension;
+ std::string stem, extension;
 
         pos = fileref.rfind('/');
         stem = pos == std::string::npos ?
@@ -792,8 +800,9 @@
         // be empty or missing.
 
         attribute_map::iterator alt_pos = attributes.find("alt");
- std::string alt_text = alt_pos != attributes.end() ?
- alt_pos->second.get_quickbook() : stem;
+ std::string alt_text = alt_pos == attributes.end() ? stem :
+ alt_pos->second.is_encoded() ? alt_pos->second.get_boostbook() :
+ alt_pos->second.get_quickbook();
         attributes.erase("alt");
 
         if(extension == ".svg")
@@ -875,13 +884,20 @@
         {
             actions.phrase << " " << attr.first << "=\"";
 
- std::string value = attr.second.get_quickbook();
- for(std::string::const_iterator
- first = value.begin(), last = value.end();
- first != last; ++first)
+ if (attr.second.is_encoded())
             {
- if (*first == '\\' && ++first == last) break;
- detail::print_char(*first, actions.phrase.get());
+ detail::print_string(attr.second.get_boostbook(),
+ actions.phrase.get());
+ }
+ else {
+ std::string value = attr.second.get_quickbook();
+ for(std::string::const_iterator
+ first = value.begin(), last = value.end();
+ first != last; ++first)
+ {
+ if (*first == '\\' && ++first == last) break;
+ detail::print_char(*first, actions.phrase.get());
+ }
             }
 
             actions.phrase << "\"";
@@ -1426,16 +1442,21 @@
         detail::markup markup = detail::get_markup(link.get_tag());
 
         value_consumer values = link;
- value dst = values.consume();
+ value dst_value = values.consume();
         value content = values.consume();
         values.finish();
+
+ // Note: dst is never actually encoded as boostbook, which
+ // is why the result is called with 'print_string' later.
+ std::string dst = dst_value.is_encoded() ?
+ dst_value.get_boostbook() : dst_value.get_quickbook();
         
         actions.phrase << markup.pre;
- detail::print_string(dst.get_quickbook(), actions.phrase.get());
+ detail::print_string(dst, actions.phrase.get());
         actions.phrase << "\">";
 
         if (content.empty())
- detail::print_string(dst.get_quickbook(), actions.phrase.get());
+ detail::print_string(dst, actions.phrase.get());
         else
             actions.phrase << content.get_boostbook();
 

Modified: branches/quickbook-dev/tools/quickbook/src/actions.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.hpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -187,11 +187,11 @@
         quickbook::actions& actions;
     };
 
- struct space_action
+ struct raw_char_action
     {
         // Prints a space
 
- space_action(collector& out)
+ raw_char_action(collector& out)
             : out(out) {}
 
         void operator()(char ch) const;

Modified: branches/quickbook-dev/tools/quickbook/src/actions_class.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions_class.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions_class.cpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -60,7 +60,7 @@
         , inline_code(phrase, *this)
         , paragraph(*this)
         , phrase_end(*this)
- , space_char(phrase)
+ , raw_char(phrase)
         , plain_char(phrase, *this)
         , escape_unicode(phrase, *this)
 

Modified: branches/quickbook-dev/tools/quickbook/src/actions_class.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions_class.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions_class.hpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -92,7 +92,7 @@
         inline_code_action inline_code;
         paragraph_action paragraph;
         phrase_end_action phrase_end;
- space_action space_char;
+ raw_char_action raw_char;
         plain_char_action plain_char;
         escape_unicode_action escape_unicode;
 

Modified: branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/block_element_grammar.cpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -31,7 +31,7 @@
                         table, table_title, table_row, variablelist,
                         varlistentry, varlistterm, list, cell,
                         preformatted, begin_section, end_section,
- xinclude, include,
+ xinclude, include, include_filename,
                         template_, template_id, template_formal_arg,
                         template_body, identifier, import,
                         element_id, element_id_1_5, element_id_1_6,
@@ -273,12 +273,12 @@
 
         local.xinclude =
                space
- >> (*(cl::anychar_p - phrase_end)) [actions.values.entry(ph::arg1, ph::arg2)]
+ >> local.include_filename
             ;
 
         local.import =
                space
- >> (*(cl::anychar_p - phrase_end)) [actions.values.entry(ph::arg1, ph::arg2)]
+ >> local.include_filename
             ;
 
         local.include =
@@ -290,7 +290,19 @@
                                                 [actions.values.entry(ph::arg1, ph::arg2, general_tags::include_id)]
>> space
             )
- >> (*(cl::anychar_p - phrase_end)) [actions.values.entry(ph::arg1, ph::arg2)]
+ >> local.include_filename
+ ;
+
+ local.include_filename =
+ qbk_before(106u)
+ >> (*(cl::anychar_p - phrase_end)) [actions.values.entry(ph::arg1, ph::arg2)]
+ | qbk_since(106u)
+ >> actions.to_value()
+ [ *( raw_escape
+ | (cl::anychar_p - phrase_end)
+ [actions.raw_char]
+ )
+ ]
             ;
 
         local.inner_block =

Modified: branches/quickbook-dev/tools/quickbook/src/grammar_impl.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/grammar_impl.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/grammar_impl.hpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -75,6 +75,7 @@
         cl::rule<scanner> inside_paragraph;
         cl::rule<scanner> command_line;
         cl::rule<scanner> escape;
+ cl::rule<scanner> raw_escape;
 
         // Miscellaneous stuff
         cl::rule<scanner> hard_space;

Modified: branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -334,7 +334,7 @@
             | escape
             | comment
             | qbk_since(106u) >> local.square_brackets
- | cl::space_p [actions.space_char]
+ | cl::space_p [actions.raw_char]
             | cl::anychar_p [actions.plain_char]
             ;
 
@@ -523,6 +523,21 @@
                 ]
             ;
 
+ raw_escape =
+ cl::str_p("\\n") [actions.error("Newlines invalid here.")]
+ | cl::str_p("\\ ") // ignore an escaped space
+ | '\\' >> cl::punct_p [actions.raw_char]
+ | "\\u" >> cl::repeat_p(4) [cl::chset<>("0-9a-fA-F")]
+ [actions.escape_unicode]
+ | "\\U" >> cl::repeat_p(8) [cl::chset<>("0-9a-fA-F")]
+ [actions.escape_unicode]
+ | ("'''" >> !eol) [actions.error("Boostbook escape invalid here.")]
+ >> (*(cl::anychar_p - "'''"))
+ >> ( cl::str_p("'''")
+ | cl::eps_p [actions.error("Unclosed boostbook escape.")]
+ ) [actions.element]
+ ;
+
         //
         // Command line
         //

Modified: branches/quickbook-dev/tools/quickbook/src/phrase_element_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/phrase_element_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/phrase_element_grammar.cpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -54,18 +54,38 @@
         local.image =
                 qbk_since(105u)
>> blank
- >> (+(
- *cl::space_p
- >> +(cl::anychar_p - (cl::space_p | phrase_end | '['))
- )) [actions.values.entry(ph::arg1, ph::arg2)]
+ >> ( qbk_before(106u)
+ >> (+(
+ *cl::space_p
+ >> +(cl::anychar_p - (cl::space_p | phrase_end | '['))
+ )) [actions.values.entry(ph::arg1, ph::arg2)]
+ | qbk_since(106u)
+ >> actions.to_value()
+ [ +( raw_escape
+ | (+cl::space_p >> ~cl::eps_p(phrase_end | '['))
+ [actions.raw_char]
+ | (cl::anychar_p - (cl::space_p | phrase_end | '['))
+ [actions.raw_char]
+ )
+ ]
+ )
>> hard_space
>> *actions.values.list()
                 [ '['
>> (*(cl::alnum_p | '_'))
                                         [actions.values.entry(ph::arg1, ph::arg2)]
>> space
- >> (*(cl::anychar_p - (phrase_end | '[')))
+ >> ( qbk_before(106u)
+ >> (*(cl::anychar_p - (phrase_end | '[')))
                                         [actions.values.entry(ph::arg1, ph::arg2)]
+ | qbk_since(106u)
+ >> actions.to_value()
+ [ *( raw_escape
+ | (cl::anychar_p - (phrase_end | '['))
+ [actions.raw_char]
+ )
+ ]
+ )
>> ']'
>> space
                 ]
@@ -91,8 +111,17 @@
 
         local.link =
                 space
- >> (*(cl::anychar_p - (']' | space)))
+ >> ( qbk_before(106u)
+ >> (*(cl::anychar_p - (']' | space)))
                                                 [actions.values.entry(ph::arg1, ph::arg2)]
+ | qbk_since(106u)
+ >> actions.to_value()
+ [ *( raw_escape
+ | (cl::anychar_p - (']' | space))
+ [actions.raw_char]
+ )
+ ]
+ )
>> hard_space
>> local.inner_phrase
             ;
@@ -103,7 +132,16 @@
 
         local.anchor =
                 blank
- >> (*(cl::anychar_p - phrase_end)) [actions.values.entry(ph::arg1, ph::arg2)]
+ >> ( qbk_before(106u)
+ >> (*(cl::anychar_p - phrase_end)) [actions.values.entry(ph::arg1, ph::arg2)]
+ | qbk_since(106u)
+ >> actions.to_value()
+ [ *( raw_escape
+ | (cl::anychar_p - phrase_end)
+ [actions.raw_char]
+ )
+ ]
+ )
             ;
 
         elements.add

Modified: branches/quickbook-dev/tools/quickbook/src/utils.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/utils.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/utils.cpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -38,11 +38,6 @@
         }
     }
 
- void print_space(char ch, std::ostream& out)
- {
- out << ch;
- }
-
     char filter_identifier_char(char ch)
     {
         if (!std::isalnum(static_cast<unsigned char>(ch)))

Modified: branches/quickbook-dev/tools/quickbook/src/utils.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/utils.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/utils.hpp 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -18,7 +18,6 @@
 namespace quickbook { namespace detail {
     void print_char(char ch, std::ostream& out);
     void print_string(std::basic_string<char> const& str, std::ostream& out);
- void print_space(char ch, std::ostream& out);
     char filter_identifier_char(char ch);
 
     template <typename Range>

Modified: branches/quickbook-dev/tools/quickbook/test/Jamfile.v2
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -21,6 +21,7 @@
 
 test-suite quickbook.test :
     [ quickbook-test anchor-1_1 ]
+ [ quickbook-test anchor-1_6 ]
     [ quickbook-test blocks-1_5 ]
     [ quickbook-test callouts-1_5 ]
     [ quickbook-test code-1_1 ]
@@ -36,6 +37,7 @@
     [ quickbook-test elements-1_5 ]
     [ quickbook-test elements-1_6 ]
     [ quickbook-test escape-1_1 ]
+ [ quickbook-test escape-1_6 ]
     [ quickbook-error-test escape-mismatched-1_5-fail ]
     [ quickbook-test heading-1_1 ]
     [ quickbook-test heading-1_3 ]
@@ -47,6 +49,7 @@
     [ quickbook-test identifier-1_5 ]
     [ quickbook-test identifier-1_6 ]
     [ quickbook-test image-1_5 ]
+ [ quickbook-test image-1_6 ]
     [ quickbook-error-test import-1_1-fail ]
     [ quickbook-error-test include-1_1-fail ]
     [ quickbook-test include-1_5 ]
@@ -54,6 +57,7 @@
     [ quickbook-test include2-1_6 ]
     [ quickbook-error-test include_win_path-1_6-fail ]
     [ quickbook-test link-1_1 ]
+ [ quickbook-test link-1_6 ]
     [ quickbook-test list_test-1_5 ]
     [ quickbook-test macro-1_5 ]
     [ quickbook-test macro-1_6 ]

Added: branches/quickbook-dev/tools/quickbook/test/anchor-1_6.gold
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/anchor-1_6.gold 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="anchor_test" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Anchor Test</title>
+ <section id="anchor_test.anchors">
+ <title><link linkend="anchor_test.anchors">Anchors</link></title>
+ <para>
+ <anchor id="a1"/>A paragraph containing several anchors. <anchor id="a2"/>We
+ want to make sure they appear in the correct place. <anchor id="a3"/>
+ </para>
+ <bridgehead renderas="sect3" id="anchor_test.anchors.h0">
+ <phrase id="anchor_test.anchors.this_heading_shouldn_t_pick_up_t"/><link linkend="anchor_test.anchors.this_heading_shouldn_t_pick_up_t">This
+ heading shouldn't pick up the previous anchor</link>
+ </bridgehead>
+ <anchor id="a4"/>
+ <bridgehead renderas="sect3" id="anchor_test.anchors.h1">
+ <phrase id="anchor_test.anchors.this_heading_should_pick_up_the_"/><link linkend="anchor_test.anchors.this_heading_should_pick_up_the_">This
+ heading should pick up the previous anchor</link>
+ </bridgehead>
+ <anchor id="a5"/>
+ <bridgehead renderas="sect3" id="anchor_test.anchors.h2">
+ <phrase id="anchor_test.anchors.and_this_one"/><link linkend="anchor_test.anchors.and_this_one">And
+ this one</link>
+ </bridgehead>
+ <anchor id="a6"/>
+ <bridgehead renderas="sect3" id="anchor_test.anchors.h3">
+ <phrase id="anchor_test.anchors.also_this_one"/><link linkend="anchor_test.anchors.also_this_one">Also
+ this one</link>
+ </bridgehead>
+ <anchor id="a7"/>
+ <bridgehead renderas="sect3" id="anchor_test.anchors.h4">
+ <phrase id="anchor_test.anchors.finally_this"/><link linkend="anchor_test.anchors.finally_this">Finally
+ this</link>
+ </bridgehead>
+ <anchor id="a8"/>
+ </section>
+ <section id="anchor_test.section_anchor">
+ <title><anchor id="a9"/><link linkend="anchor_test.section_anchor">Section Anchor</link></title>
+ <section id="anchor_test.section_anchor.nested_section">
+ <title><anchor id="a10"/><link linkend="anchor_test.section_anchor.nested_section">Nested
+ Section</link></title>
+ </section>
+ <anchor id="a11"/>
+ </section>
+ <section id="anchor_test.conditional_section_anchor">
+ <title><anchor id="a12"/><link linkend="anchor_test.conditional_section_anchor">Conditional
+ Section Anchor</link></title>
+ </section>
+ <section id="anchor_test.lists">
+ <title><link linkend="anchor_test.lists">Lists</link></title> <anchor id="a14"/>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ Item 1
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Item 2
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Nested List <anchor id="a15"/>
+ <itemizedlist>
+ <listitem>
+ <simpara>
+ Nested Item 1
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Nested Item 2
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ <anchor id="a16"/>Nested Item 3
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </simpara>
+ </listitem>
+ <listitem>
+ <simpara>
+ Item 3
+ </simpara>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section id="anchor_test.anchors_in_templates">
+ <title><link linkend="anchor_test.anchors_in_templates">Anchors in templates</link></title>
+ <para>
+ <anchor id="t1"/>Some text.
+ </para>
+ <para>
+ <anchor id="t2"/>Text content
+ </para>
+ </section>
+ <section id="anchor_test.anchors_in_syntax_highlighted_co">
+ <title><link linkend="anchor_test.anchors_in_syntax_highlighted_co">Anchors in
+ syntax highlighted code</link></title>
+<programlisting><phrase role="keyword">int</phrase> <anchor id="s1"/><phrase role="identifier">main</phrase><phrase role="special">()</phrase> <phrase role="special">{}</phrase>
+</programlisting>
+ </section>
+ <section id="anchor_test.nested_anchors">
+ <title><link linkend="anchor_test.nested_anchors">Nested anchors</link></title>
+ <table frame="all" id="anchor_test.nested_anchors.table_with_anchors">
+ <title>Table with anchors</title>
+ <tgroup cols="1">
+ <thead>
+ <row>
+ <entry>
+ <para>
+ Heading
+ </para>
+ </entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>
+ <para>
+ <anchor id="table1"/>Cell 1
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ <anchor id="table2"/>Cell 2
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry>
+ <para>
+ Cell 3<anchor id="table3"/>
+ </para>
+ </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section id="anchor_test.anchors_with_escapes">
+ <title><link linkend="anchor_test.anchors_with_escapes">Anchors with escapes</link></title>
+ <anchor id="[oddid]"/>
+ </section>
+</article>

Added: branches/quickbook-dev/tools/quickbook/test/anchor-1_6.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/anchor-1_6.quickbook 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -0,0 +1,88 @@
+[article Anchor Test
+[quickbook 1.6]
+]
+
+[section Anchors]
+
+[#a1] A paragraph containing several anchors. [#a2] We want to make sure
+they appear in the correct place. [#a3]
+
+[heading This heading shouldn't pick up the previous anchor]
+
+[#a4]
+
+[heading This heading should pick up the previous anchor]
+
+[#a5]
+[heading And this one]
+
+[#a6][heading Also this one]
+
+[#a7][h3 Finally this]
+
+[#a8]
+
+[endsect]
+
+[#a9]
+[section Section Anchor]
+[#a10][section Nested Section]
+[endsect]
+[/ This anchor is invalid, I'm not sure what to do with it]
+[#a11]
+[endsect]
+
+[#a12][?__not_defined__ #a13]
+[section Conditional Section Anchor]
+[endsect]
+
+[section Lists]
+
+[#a14]
+* Item 1
+* Item 2
+* Nested List
+ [#a15]
+ * Nested Item 1
+ * Nested Item 2
+ * [#a16] Nested Item 3
+* Item 3
+
+[endsect]
+
+[section Anchors in templates]
+
+[template anchor1[][#t1]]
+[template para[] Text content]
+
+[anchor1]
+
+Some text.
+
+[#t2]
+
+[para]
+
+[endsect]
+
+[section Anchors in syntax highlighted code]
+
+ int ``[#s1]``main() {}
+
+[endsect]
+
+[section Nested anchors]
+
+[table Table with anchors
+ [[Heading]]
+ [[[#table1]Cell 1]]
+ [[[#table2] Cell 2]]
+ [[Cell 3[#table3]]]
+]
+[endsect]
+
+[section Anchors with escapes]
+
+[#\[oddid\]]
+
+[endsect]
\ No newline at end of file

Modified: branches/quickbook-dev/tools/quickbook/test/escape-1_1.gold
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/escape-1_1.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/escape-1_1.gold 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -25,5 +25,8 @@
     <para>
       <emphasis>This will be escaped</emphasis>
     </para>
+ <para>
+ \[ generates [. \] generates ].
+ </para>
   </section>
 </article>

Modified: branches/quickbook-dev/tools/quickbook/test/escape-1_1.quickbook
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/escape-1_1.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/escape-1_1.quickbook 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -28,4 +28,7 @@
 
 [`escapedtemplate]
 
+\\\[ generates \[.
+\\\] generates \].
+
 [endsect]

Copied: branches/quickbook-dev/tools/quickbook/test/escape-1_6.gold (from r75359, /branches/quickbook-dev/tools/quickbook/test/escape-1_1.gold)
==============================================================================
--- /branches/quickbook-dev/tools/quickbook/test/escape-1_1.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/escape-1_6.gold 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -3,7 +3,7 @@
 <article id="escape" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
   <title>Escape</title>
   <section id="escape.escape">
- <title>Escape</title>
+ <title><link linkend="escape.escape">Escape</link></title>
     <para>
       <emphasis>Da do do do. Da da da da. That's all I have to say to you.</emphasis>
     </para>
@@ -25,5 +25,8 @@
     <para>
       <emphasis>This will be escaped</emphasis>
     </para>
+ <para>
+ \[ generates [. \] generates ].
+ </para>
   </section>
 </article>

Copied: branches/quickbook-dev/tools/quickbook/test/escape-1_6.quickbook (from r75359, /branches/quickbook-dev/tools/quickbook/test/escape-1_1.quickbook)
==============================================================================
--- /branches/quickbook-dev/tools/quickbook/test/escape-1_1.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/escape-1_6.quickbook 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -1,4 +1,5 @@
 [article Escape
+[quickbook 1.6]
 ]
 
 [section Escape]
@@ -28,4 +29,7 @@
 
 [`escapedtemplate]
 
+\\\[ generates \[.
+\\\] generates \].
+
 [endsect]

Added: branches/quickbook-dev/tools/quickbook/test/image-1_6.gold
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/image-1_6.gold 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="images_1_6" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Images 1.6</title>
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>test</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test this.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>test this</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test&amp;this.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>test&amp;this</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"
+ height="10cm" width="10cm"></imagedata></imageobject>
+ <textobject>
+ <phrase>test</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>Foo</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>Foobie foobie foo</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>Foo &amp; bar</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"
+ height="10cm" width="10cm"></imagedata></imageobject>
+ <textobject>
+ <phrase>Foo</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"
+ height="10cm" width="10cm"></imagedata></imageobject>
+ <textobject>
+ <phrase>Foo[]</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </para>
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>test</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>test</phrase>
+ </textobject>
+ </inlinemediaobject> <inlinemediaobject><imageobject><imagedata fileref="test.gif"></imagedata></imageobject>
+ <textobject>
+ <phrase>comment</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </para>
+ <para>
+ <inlinemediaobject><imageobject><imagedata fileref="test.gif" height="10cm" width="10cm"></imagedata></imageobject>
+ <textobject>
+ <phrase>test</phrase>
+ </textobject>
+ </inlinemediaobject>
+ </para>
+</article>

Added: branches/quickbook-dev/tools/quickbook/test/image-1_6.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/image-1_6.quickbook 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -0,0 +1,20 @@
+[article Images 1.6
+ [quickbook 1.6]
+]
+
+[$test.gif]
+[$test this.gif]
+[$test&this.gif]
+[$test.gif [width 10cm] [height 10cm]]
+[$test.gif [alt Foo]]
+[$test.gif [alt Foobie foobie foo]]
+[$test.gif [alt Foo & bar]]
+[$test.gif [alt Foo] [width 10cm] [height 10cm]]
+[$test.gif [alt Foo\[\]] [width 10cm] [height 10cm]]
+
+[$ [/comment] test.gif ]
+[$ [/comment] test.gif [/comment] ]
+[$ [/comment] test.gif [/comment] [alt comment] ]
+
+[/ This should warn about repeated attribute and then ignore it. ]
+[$test.gif [width 10cm] [height 10cm] [width 20cm]]

Added: branches/quickbook-dev/tools/quickbook/test/link-1_6.gold
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/link-1_6.gold 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE article PUBLIC "-//Boost//DTD BoostBook XML V1.0//EN" "http://www.boost.org/tools/boostbook/dtd/boostbook.dtd">
+<article id="link_tests" last-revision="DEBUG MODE Date: 2000/12/20 12:00:00 $" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <title>Link tests</title>
+ <section id="link_tests.different_types_of_links">
+ <title><link linkend="link_tests.different_types_of_links">Different types of
+ links</link></title>
+ <para>
+ <ulink url="http://www.boost.org/">http://www.boost.org/> <ulink url="http://www.boost.org/">Boost</ulink>
+ <link linkend="link-id">link-id</link> <link linkend="link-id">Link Text</link>
+ <anchor id="link-id"/><functionname alt="foo">foo</functionname> <functionname
+ alt="foo">link text</functionname> <classname alt="foo">foo</classname> <classname
+ alt="foo">link text</classname> <methodname alt="foo">foo</methodname> <methodname
+ alt="foo">link text</methodname> <enumname alt="foo">foo</enumname> <enumname
+ alt="foo">link text</enumname> <macroname alt="foo">foo</macroname> <macroname
+ alt="foo">link text</macroname> <headername alt="foo">foo</headername> <headername
+ alt="foo">link text</headername> <conceptname alt="foo">foo</conceptname>
+ <conceptname alt="foo">link text</conceptname> <globalname alt="foo">foo</globalname>
+ <globalname alt="foo">link text</globalname>
+ </para>
+ <para>
+ <link linkend="link">description</link>
+ </para>
+ <para>
+ <link linkend="link[Hello]">description</link>
+ </para>
+ </section>
+ <section id="link_tests.side_by_side_links">
+ <title><link linkend="link_tests.side_by_side_links">Side-by-side links</link></title>
+ <para>
+ <link linkend="x">x</link> and <link linkend="y">y</link> are two distinct
+ links, which should be separated by whitespace when they appear together as
+ in <link linkend="x">x</link> <link linkend="y">y</link>. Also in <link linkend="x">x</link>
+ <link linkend="y">y</link>, and in <link linkend="x">x</link> <link linkend="y">y</link>
+ as well.
+ </para>
+ </section>
+</article>

Added: branches/quickbook-dev/tools/quickbook/test/link-1_6.quickbook
==============================================================================
--- (empty file)
+++ branches/quickbook-dev/tools/quickbook/test/link-1_6.quickbook 2011-11-06 17:22:42 EST (Sun, 06 Nov 2011)
@@ -0,0 +1,45 @@
+[article Link tests
+[quickbook 1.6]
+]
+
+[section Different types of links]
+
+[@http://www.boost.org/]
+[@ http://www.boost.org/ Boost]
+[link link-id]
+[link link-id Link Text]
+[#link-id]
+[funcref foo]
+[funcref foo link text]
+[classref foo]
+[classref foo link text]
+[memberref foo]
+[memberref foo link text]
+[enumref foo]
+[enumref foo link text]
+[macroref foo]
+[macroref foo link text]
+[headerref foo]
+[headerref foo link text]
+[conceptref foo]
+[conceptref foo link text]
+[globalref foo]
+[globalref foo link text]
+
+[link link[/ comment]description]
+
+[link link\[Hello\] description]
+
+
+[endsect]
+
+[section Side-by-side links]
+
+[link x] and [link y] are two distinct links, which should be separated by
+whitespace when they appear together as in [link x] [link y]. Also in [link x]
+[link y], and in
+[link x]
+[link y]
+as well.
+
+[endsect]


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk