Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72760 - in trunk/tools/quickbook: doc src test
From: dnljms_at_[hidden]
Date: 2011-06-26 06:44:02


Author: danieljames
Date: 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
New Revision: 72760
URL: http://svn.boost.org/trac/boost/changeset/72760

Log:
Quickbook: xml encode escaped punctuation.
Text files modified:
   trunk/tools/quickbook/doc/quickbook.qbk | 4 ++++
   trunk/tools/quickbook/src/actions.cpp | 16 ----------------
   trunk/tools/quickbook/src/actions.hpp | 16 ----------------
   trunk/tools/quickbook/src/actions_class.cpp | 1 -
   trunk/tools/quickbook/src/actions_class.hpp | 1 -
   trunk/tools/quickbook/src/doc_info_grammar.cpp | 2 +-
   trunk/tools/quickbook/src/main_grammar.cpp | 2 +-
   trunk/tools/quickbook/test/escape.gold | 3 +++
   trunk/tools/quickbook/test/escape.quickbook | 2 ++
   trunk/tools/quickbook/test/simple_markup.gold | 2 +-
   trunk/tools/quickbook/test/simple_markup.quickbook | 2 +-
   11 files changed, 13 insertions(+), 38 deletions(-)

Modified: trunk/tools/quickbook/doc/quickbook.qbk
==============================================================================
--- trunk/tools/quickbook/doc/quickbook.qbk (original)
+++ trunk/tools/quickbook/doc/quickbook.qbk 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -294,6 +294,10 @@
     `[ordered_list [item1][item2]]` or
     `[itemized_list [item1][item2]]`.
 
+[heading Version 1.5.6 - Boost 1.48]
+
+* Xml encode escaped punctuation (eg. `\<` is correctly encodes to \<).
+
 [endsect] [/Change log]
 
 [section:syntax Syntax Summary]

Modified: trunk/tools/quickbook/src/actions.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions.cpp (original)
+++ trunk/tools/quickbook/src/actions.cpp 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -664,22 +664,6 @@
         out << "</code>";
     }
 
- void raw_char_action::operator()(char ch) const
- {
- if (actions.suppress) return;
- write_anchors(actions, phrase);
-
- phrase << ch;
- }
-
- void raw_char_action::operator()(iterator first, iterator /*last*/) const
- {
- if (actions.suppress) return;
- write_anchors(actions, phrase);
-
- phrase << *first;
- }
-
     void plain_char_action::operator()(char ch) const
     {
         if (actions.suppress) return;

Modified: trunk/tools/quickbook/src/actions.hpp
==============================================================================
--- trunk/tools/quickbook/src/actions.hpp (original)
+++ trunk/tools/quickbook/src/actions.hpp 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -252,22 +252,6 @@
         std::string& save;
     };
 
- struct raw_char_action
- {
- // Prints a single raw (unprocessed) char.
- // Allows '<', '>'... etc.
-
- raw_char_action(collector& phrase, quickbook::actions& actions)
- : phrase(phrase)
- , actions(actions) {}
-
- void operator()(char ch) const;
- void operator()(iterator first, iterator /*last*/) const;
-
- collector& phrase;
- quickbook::actions& actions;
- };
-
     struct plain_char_action
     {
         // Prints a single plain char.

Modified: trunk/tools/quickbook/src/actions_class.cpp
==============================================================================
--- trunk/tools/quickbook/src/actions_class.cpp (original)
+++ trunk/tools/quickbook/src/actions_class.cpp 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -72,7 +72,6 @@
         , paragraph(*this)
         , space_char(phrase)
         , plain_char(phrase, *this)
- , raw_char(phrase, *this)
         , escape_unicode(phrase, *this)
 
         , simple_markup(phrase, *this)

Modified: trunk/tools/quickbook/src/actions_class.hpp
==============================================================================
--- trunk/tools/quickbook/src/actions_class.hpp (original)
+++ trunk/tools/quickbook/src/actions_class.hpp 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -121,7 +121,6 @@
         paragraph_action paragraph;
         space space_char;
         plain_char_action plain_char;
- raw_char_action raw_char;
         escape_unicode_action escape_unicode;
 
         simple_phrase_action simple_markup;

Modified: trunk/tools/quickbook/src/doc_info_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/doc_info_grammar.cpp (original)
+++ trunk/tools/quickbook/src/doc_info_grammar.cpp 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -240,7 +240,7 @@
         local.char_ =
                 cl::str_p("\\n") [actions.break_]
             | "\\ " // ignore an escaped space
- | '\\' >> cl::punct_p [actions.raw_char]
+ | '\\' >> cl::punct_p [actions.plain_char]
             | "\\u" >> cl::repeat_p(4)
                     [cl::chset<>("0-9a-fA-F")]
                                             [actions.escape_unicode]

Modified: trunk/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- trunk/tools/quickbook/src/main_grammar.cpp (original)
+++ trunk/tools/quickbook/src/main_grammar.cpp 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -457,7 +457,7 @@
         local.escape =
                 cl::str_p("\\n") [actions.break_]
             | cl::str_p("\\ ") // ignore an escaped space
- | '\\' >> cl::punct_p [actions.raw_char]
+ | '\\' >> cl::punct_p [actions.plain_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")]

Modified: trunk/tools/quickbook/test/escape.gold
==============================================================================
--- trunk/tools/quickbook/test/escape.gold (original)
+++ trunk/tools/quickbook/test/escape.gold 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -10,5 +10,8 @@
     <para>
       This letter &#x3B1; should have a space either side of it.
     </para>
+ <para>
+ These should be properly encoded: &gt; &lt; &quot;
+ </para>
   </section>
 </article>

Modified: trunk/tools/quickbook/test/escape.quickbook
==============================================================================
--- trunk/tools/quickbook/test/escape.quickbook (original)
+++ trunk/tools/quickbook/test/escape.quickbook 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -9,5 +9,7 @@
 
 This letter '''&#x3B1;''' should have a space either side of it.
 
+These should be properly encoded: \> \< \"
+
 [endsect]
 

Modified: trunk/tools/quickbook/test/simple_markup.gold
==============================================================================
--- trunk/tools/quickbook/test/simple_markup.gold (original)
+++ trunk/tools/quickbook/test/simple_markup.gold 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -46,7 +46,7 @@
       <literal>_mac\ ro_</literal>
     </para>
     <para>
- <emphasis>not italic\</emphasis>
+ <emphasis>italic\</emphasis>
     </para>
     <para>
       These shouldn't be interepted as markup: == // **

Modified: trunk/tools/quickbook/test/simple_markup.quickbook
==============================================================================
--- trunk/tools/quickbook/test/simple_markup.quickbook (original)
+++ trunk/tools/quickbook/test/simple_markup.quickbook 2011-06-26 06:44:00 EDT (Sun, 26 Jun 2011)
@@ -33,7 +33,7 @@
 
 =_mac\ ro_=
 
-/not italic\/
+/italic\/
 
 These shouldn't be interepted as markup: == // **
 


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