unified indentation (spaces instead of tabs)
fixed non-ascii handling for creoleparser (working around a possible creoleparser-bug that causes parsing to fail for unicode text with umlauts - only utf-8 encoded strings work)
This commit is contained in:
parent
81bf19c802
commit
34acd9bf36
1 changed files with 17 additions and 15 deletions
|
@ -5,17 +5,19 @@
|
|||
xmlns:py="http://genshi.edgewall.org/">
|
||||
<xi:include href="../layout.html" />
|
||||
|
||||
<?python
|
||||
|
||||
#text can be creole-encoded, see http://www.wikicreole.org/imageServlet?page=CheatSheet%2Fcreole_cheat_sheet.png&width=340
|
||||
title = "Brainstorming Online"
|
||||
content01 = unicode("""
|
||||
<?python
|
||||
from creoleparser import text2html
|
||||
|
||||
#text can be creole-encoded, see http://www.wikicreole.org/imageServlet?page=CheatSheet%2Fcreole_cheat_sheet.png&width=340
|
||||
title = "Brainstorming Online"
|
||||
# creoleparser seems to require "utf-8" encoded strings - unicode does not work (this seems to be a bug)
|
||||
content01 = """
|
||||
dieser mehrzeilige Text ist HTML-escaped und kann Umlaute enthalten.
|
||||
Falls er <Umlaute> **enthaelt**, dann muss die Datei utf8-codiert sein und der Text
|
||||
Falls er <Umlaute> **enthält**, dann muss die Datei utf8-codiert sein und der Text
|
||||
muss in unicode verwandelt werden (unicode(foo)).
|
||||
""")
|
||||
from creoleparser import text2html
|
||||
?>
|
||||
""".encode("utf-8")
|
||||
content01 = text2html(content01, encoding=None)
|
||||
?>
|
||||
|
||||
|
||||
<head>
|
||||
|
@ -23,12 +25,12 @@
|
|||
</head>
|
||||
<body>
|
||||
<h1>${title}</h1>
|
||||
<div class="post">
|
||||
|
||||
${Markup(text2html(content01))}
|
||||
</div>
|
||||
${poll_new_small()}
|
||||
|
||||
<div class="post">
|
||||
|
||||
${Markup(content01)}
|
||||
</div>
|
||||
${poll_new_small()}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
|
Loading…
Reference in a new issue