##// END OF EJS Templates
fix utf8, add utf8 in html headers
Matthias BUSSONNIER -
Show More
@@ -298,8 +298,8 b' class Converter(object):'
298 outfile = self.outbase + '.' + self.extension
298 outfile = self.outbase + '.' + self.extension
299 if encoding is None:
299 if encoding is None:
300 encoding = self.default_encoding
300 encoding = self.default_encoding
301 with open(outfile, 'w') as f:
301 with io.open(outfile, 'w', encoding=encoding) as f:
302 f.write(self.output.encode(encoding))
302 f.write(self.output)
303 return os.path.abspath(outfile)
303 return os.path.abspath(outfile)
304
304
305 def optional_header(self):
305 def optional_header(self):
@@ -781,6 +781,7 b' class ConverterHTML(Converter):'
781
781
782 # pygments css
782 # pygments css
783 pygments_css = HtmlFormatter().get_style_defs('.highlight')
783 pygments_css = HtmlFormatter().get_style_defs('.highlight')
784 header.extend(['<meta charset="UTF-8">'])
784 header.extend(self.in_tag('style', pygments_css, dict(type='text/css')))
785 header.extend(self.in_tag('style', pygments_css, dict(type='text/css')))
785
786
786 # TODO: this should be allowed to use local mathjax:
787 # TODO: this should be allowed to use local mathjax:
@@ -1327,7 +1328,6 b' def md2html(infile):'
1327
1328
1328 <head>
1329 <head>
1329 <title>{infile}</title>
1330 <title>{infile}</title>
1330
1331 <style type="text/css">
1331 <style type="text/css">
1332 {css}
1332 {css}
1333 </style>
1333 </style>
General Comments 0
You need to be logged in to leave comments. Login now