summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAren Villanueva <arenvillanueva@yomogi-soft.com>2015-11-18 22:33:29 +1100
committerAren Villanueva <arenvillanueva@yomogi-soft.com>2015-11-19 22:01:42 +1100
commit5c7e9e7e633088fae7e9c9e30c3814a1b2a7207c (patch)
tree7fde4da8bd507cb9b78e7e7f30255356cfb73067 /tools
parent36d620c633be55ac402892bce816d4a9b4d67bee (diff)
Fixes the make_doc.sh, <, > and & signs in descriptions that cause the parser to break.
Documentation for HTTPClient. Added a query_string_from_dict method to HTTPClient to create a x-www-form-urlencoded valid query string for GET and POST messages. String now has http_escape() and http_unescape() methods to help facilitate the above query_string_from_dict method.
Diffstat (limited to 'tools')
-rw-r--r--tools/doc/doc_data.cpp2
-rw-r--r--tools/docdump/makehtml.py19
2 files changed, 18 insertions, 3 deletions
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp
index 432f358627..c1d3e5e314 100644
--- a/tools/doc/doc_data.cpp
+++ b/tools/doc/doc_data.cpp
@@ -189,9 +189,11 @@ void DocData::generate(bool p_basic_types) {
arginfo=E->get().return_val;
if (arginfo.type==Variant::NIL)
continue;
+#ifdef DEBUG_METHODS_ENABLED
if (m && m->get_return_type()!=StringName())
method.return_type=m->get_return_type();
else
+#endif
method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type);
} else {
diff --git a/tools/docdump/makehtml.py b/tools/docdump/makehtml.py
index d533ca1b8b..9b9c62f33b 100644
--- a/tools/docdump/makehtml.py
+++ b/tools/docdump/makehtml.py
@@ -1,5 +1,19 @@
import sys
import xml.etree.ElementTree as ET
+from xml.sax.saxutils import escape, unescape
+
+html_escape_table = {
+ '"': "&quot;",
+ "'": "&apos;"
+}
+
+html_unescape_table = {v:k for k, v in html_escape_table.items()}
+
+def html_escape(text):
+ return escape(text, html_escape_table)
+
+def html_unescape(text):
+ return unescape(text, html_unescape_table)
input_list = []
@@ -96,7 +110,7 @@ def make_html_class_list(class_list,columns):
idx=0
for n in class_list:
- col = idx/col_max
+ col = int(idx/col_max)
if (col>=columns):
col=columns-1
fit_columns[col]+=[n]
@@ -299,6 +313,7 @@ def make_type(p_type,p_parent):
def make_text_def(class_name,parent,text):
+ text = html_escape(text)
pos=0
while(True):
pos = text.find("[",pos)
@@ -598,7 +613,6 @@ def make_html_class(node):
descr=node.find("description")
if (descr!=None and descr.text.strip()!=""):
-
h4=ET.SubElement(div,"h4")
h4.text="Description:"
@@ -644,7 +658,6 @@ def make_html_class(node):
class_names=[]
classes={}
-
for file in input_list:
tree = ET.parse(file)
doc=tree.getroot()