From fba3b6d1979c1d1ad0d56d46fc2d787f111c07fb Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 26 Jun 2014 09:46:14 +0200 Subject: Updated to freetype 2.5.3 --- freetype/src/tools/docmaker/tohtml.py | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) (limited to 'freetype/src/tools/docmaker/tohtml.py') diff --git a/freetype/src/tools/docmaker/tohtml.py b/freetype/src/tools/docmaker/tohtml.py index fffa12097..7944f1c99 100644 --- a/freetype/src/tools/docmaker/tohtml.py +++ b/freetype/src/tools/docmaker/tohtml.py @@ -1,4 +1,4 @@ -# ToHTML (c) 2002, 2003, 2005, 2006, 2007, 2008 +# ToHTML (c) 2002, 2003, 2005-2008, 2013 # David Turner from sources import * @@ -175,25 +175,6 @@ def html_quote( line ): return result -# same as 'html_quote', but ignores left and right brackets -def html_quote0( line ): - return string.replace( line, "&", "&" ) - - -def dump_html_code( lines, prefix = "" ): - # clean the last empty lines - l = len( self.lines ) - while l > 0 and string.strip( self.lines[l - 1] ) == "": - l = l - 1 - - # The code footer should be directly appended to the last code - # line to avoid an additional blank line. - print prefix + code_header, - for line in self.lines[0 : l + 1]: - print '\n' + prefix + html_quote( line ), - print prefix + code_footer, - - class HtmlFormatter( Formatter ): @@ -242,16 +223,6 @@ class HtmlFormatter( Formatter ): def make_block_url( self, block ): return self.make_section_url( block.section ) + "#" + block.name - def make_html_words( self, words ): - """ convert a series of simple words into some HTML text """ - line = "" - if words: - line = html_quote( words[0] ) - for w in words[1:]: - line = line + " " + html_quote( w ) - - return line - def make_html_word( self, word ): """analyze a simple word to detect cross-references and styling""" # look for cross-references @@ -291,6 +262,8 @@ class HtmlFormatter( Formatter ): line = self.make_html_word( words[0] ) for word in words[1:]: line = line + " " + self.make_html_word( word ) + # handle hyperlinks + line = re_url.sub( r'\1', line ) # convert `...' quotations into real left and right single quotes line = re.sub( r"(^|\W)`(.*?)'(\W|$)", \ r'\1‘\2’\3', \ @@ -549,7 +522,7 @@ class HtmlFormatter( Formatter ): if block.source.filename.find( f ) >= 0: header = self.headers[f] + ' (' + f + ')' break; - + # if not header: # sys.stderr.write( \ # 'WARNING: No header macro for ' + block.source.filename + '.\n' ) -- cgit v1.2.3