This is an automated email from the ASF dual-hosted git repository.

alexey pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit 8c4fedc1d1ecf3aede8c21231a46f1ef7e328c6f
Author: Andrew Wong <[email protected]>
AuthorDate: Tue Apr 9 17:25:33 2019 -0700

    tools: escape brackets when generating XML
    
    When building the site, we generate the XML for tools. Usually we escape
    ambiguous characters for tooling arguments; it seems that wasn't the
    case for arguments that are GFlags. This meant that before, we would run
    into errors like the following when generating the site (new in 1.9.0
    for the --predicates argument of the new `table scan` tool):
    
    /kudu/build/release/gen-docs/kudu.xml:49: parser error : StartTag: invalid 
element name
     * The 'Comparison' type supports <=, <, =, >, and >=,
                                           ^
    
    Change-Id: I16c13d86b0b452e0559e245ee33373078e5e3713
    Reviewed-on: http://gerrit.cloudera.org:8080/12981
    Reviewed-by: Adar Dembo <[email protected]>
    Reviewed-by: Grant Henke <[email protected]>
    Tested-by: Andrew Wong <[email protected]>
---
 src/kudu/tools/tool_action.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/kudu/tools/tool_action.cc b/src/kudu/tools/tool_action.cc
index 54291ba..5ed62fd 100644
--- a/src/kudu/tools/tool_action.cc
+++ b/src/kudu/tools/tool_action.cc
@@ -381,10 +381,11 @@ string Action::BuildHelpXML(const vector<Mode*>& chain) 
const {
     xml += "<argument>";
     xml += "<kind>optional</kind>";
     xml += Substitute("<name>$0</name>", gflag_info.name);
-    xml += Substitute("<description>$0</description>", gflag_info.description);
+    xml += Substitute("<description>$0</description>",
+                      EscapeForHtmlToString(gflag_info.description));
     xml += Substitute("<type>$0</type>", gflag_info.type);
     xml += Substitute("<default_value>$0</default_value>",
-                      gflag_info.default_value);
+                      EscapeForHtmlToString(gflag_info.default_value));
     xml += "</argument>";
   }
   xml += Substitute("<usage>$0</usage>", EscapeForHtmlToString(usage));

Reply via email to