[pygobject] Doc Extractor: Use replacements that make sense for &...; expressions.



commit 11fa39a861abf679e01b5f0da97be93ae0adf0f0
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Sun Apr 18 20:22:21 2010 -0400

    	Doc Extractor: Use replacements that make sense for &...; expressions.
    
    	* codegen/docextract_to_xml.py: Use &#35; and &#160; respectively for
    	&num; (#) and &nbsp;.  These are interpreted correctly in XML and will
    	not make the parsing crash.

 codegen/docextract_to_xml.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/docextract_to_xml.py b/codegen/docextract_to_xml.py
index 775b57d..7ac1053 100755
--- a/codegen/docextract_to_xml.py
+++ b/codegen/docextract_to_xml.py
@@ -34,8 +34,8 @@ def escape_text(unescaped_text):
     escaped_text = string.replace(escaped_text, '&ast;', '*')
     escaped_text = string.replace(escaped_text, '&percnt;', '%')
     escaped_text = string.replace(escaped_text, '&commat;', '@')
-    escaped_text = string.replace(escaped_text, '&num;', '')
-    escaped_text = string.replace(escaped_text, '&nbsp;', ' ')
+    escaped_text = string.replace(escaped_text, '&num;', '&#35;')
+    escaped_text = string.replace(escaped_text, '&nbsp;', '&#160;')
     # This represents a '/' before or after an '*' so replace with slash but
     # with spaces.
     escaped_text = string.replace(escaped_text, '&sol;', ' / ')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]