fixed html quoting in DocMaker
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
diff --git a/ChangeLog b/ChangeLog
index dd1e8d1..05421ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
-2002-01-06 David Turner <david@freetype.org>
+2002-01-07 David Turner <david@freetype.org>
* docs/BUGS, docs/CHANGES: updating documentation for 2.0.6 release
+ * src/tools/docmaker.py: fixed HTML quoting in sources
+
* include/freetype/config/ftoption.h: setting default options for
a release build (debugging off, bytecode interpreter off)
diff --git a/src/tools/docmaker.py b/src/tools/docmaker.py
index a20f22b..a818d1a 100644
--- a/src/tools/docmaker.py
+++ b/src/tools/docmaker.py
@@ -171,12 +171,17 @@ def sort_order_list( input_list, order_list ):
# Translate a single line of source to HTML. This will convert
# a "<" into "<.", ">" into ">.", etc.
#
-def html_format( line ):
- result = string.replace( line, "<", "<." )
- result = string.replace( line, ">", ">." )
- result = string.replace( line, "&", "&." )
+def html_quote( line ):
+ result = string.replace( line, "&", "&" )
+ result = string.replace( result, "<", "<" )
+ result = string.replace( result, ">", ">" )
return result
+# same as 'html_quote', but ignores left and right brackets
+#
+def html_quote0( line ):
+ return string.replace( line, "&", "&" )
+
# Open the standard output to a given project documentation file. Use
# "output_dir" to determine the filename location if necessary and save the
@@ -355,10 +360,10 @@ class DocCode:
# The code footer should be directly appended to the last code
# line to avoid an additional blank line.
#
- sys.stdout.write( code_header )
+ print code_header,
for line in self.lines[0 : l+1]:
- sys.stdout.write( '\n' + html_format(line) )
- sys.stdout.write( code_footer )
+ print '\n' + html_quote(line),
+ print code_footer,
@@ -435,7 +440,7 @@ class DocParagraph:
word = '?' + word
if cursor + len( word ) + 1 > max_width:
- print html_format( line )
+ print html_quote0(line)
cursor = 0
line = ""
@@ -451,7 +456,7 @@ class DocParagraph:
#
if extra:
if cursor + len( extra ) + 1 > max_width:
- print html_format( line )
+ print html_quote0(line)
cursor = 0
line = ""
@@ -460,7 +465,7 @@ class DocParagraph:
extra = None
if cursor > 0:
- print html_format(line)
+ print html_quote0(line)
# print "§" # for debugging only
@@ -877,7 +882,7 @@ class DocBlock:
print source_header
print ""
for line in lines[0 : l+1]:
- print line
+ print html_quote(line)
print source_footer
in_table = 0