kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ale...@apache.org
Subject [kudu] branch branch-1.9.x updated: tools: escape brackets when generating XML
Date Thu, 11 Apr 2019 01:16:41 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-1.9.x by this push:
     new 6a9cf41  tools: escape brackets when generating XML
6a9cf41 is described below

commit 6a9cf41cc16760398f0c6de8a670fc58f4978b84
Author: Andrew Wong <awong@apache.org>
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 <adar@cloudera.com>
    Reviewed-by: Grant Henke <granthenke@apache.org>
    Tested-by: Andrew Wong <awong@cloudera.com>
    (cherry picked from commit 4eb74ae233fadf5184632f4b291b0befeb371dd5)
    Reviewed-on: http://gerrit.cloudera.org:8080/12988
    Tested-by: Kudu Jenkins
---
 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));


Mime
View raw message