aboutsummaryrefslogtreecommitdiffstats
path: root/docs/using_as_module.txt
diff options
context:
space:
mode:
authorWaylan Limberg <waylan@gmail.com>2011-07-28 10:02:38 -0400
committerWaylan Limberg <waylan@gmail.com>2011-07-28 10:02:38 -0400
commit80f6ac599f79546512b522566cb421acea1aca19 (patch)
treeb60ff3b1680a8d79e74fe87d9f12099fc970e089 /docs/using_as_module.txt
parent5ad27f85db3e5c0a0e6f05ab099bfbfc8b0d0dd5 (diff)
downloadmarkdown-80f6ac599f79546512b522566cb421acea1aca19.tar.gz
markdown-80f6ac599f79546512b522566cb421acea1aca19.tar.bz2
markdown-80f6ac599f79546512b522566cb421acea1aca19.zip
All internal encoding of output now uses the 'xmlcharrefreplace' error handler. Also added a note to the docs. Anyone doing their own encoding of output should be as well.
Diffstat (limited to 'docs/using_as_module.txt')
-rw-r--r--docs/using_as_module.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/using_as_module.txt b/docs/using_as_module.txt
index 343fee0..f50a0ec 100644
--- a/docs/using_as_module.txt
+++ b/docs/using_as_module.txt
@@ -39,7 +39,10 @@ The following options are available on the `markdown.markdown` function:
If you want to write the output to disk, you must encode it yourself:
- output_file = codecs.open("some_file.html", "w", encoding="utf-8")
+ output_file = codecs.open("some_file.html", "w",
+ encoding="utf-8",
+ errors="xmlcharrefreplace"
+ )
output_file.write(html)
* `extensions`: A list of extensions.
@@ -178,7 +181,8 @@ the following required options:
* or `None` (default) which will write to `stdout`.
* `encoding`: The encoding of the source text file. Defaults to
- "utf-8". The same encoding will always be used for the output file.
+ "utf-8". The same encoding will always be used for the output file.
+ The 'xmlcharrefreplace' error handler is used when encoding the output.
**Note:** This is the only place that decoding and encoding of unicode
takes place in Python-Markdown. If this rather naive solution does not