Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsheep@ghostwheel <sheep@ghostwheel>2009-04-05 10:34:43 (GMT)
committer sheep@ghostwheel <sheep@ghostwheel>2009-04-05 10:34:43 (GMT)
commitaef793f80cc5bd1617894e6ab96dad1c0a510c59 (patch)
tree7e7e156d1f08e53c25f59dee88e4b0bb1c15eb55
parent5d4995d55316ee98c9b2c88aafb8b7808454dcfa (diff)
update version to 1.3.11.3.1
-rwxr-xr-xhatta.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/hatta.py b/hatta.py
index 818703d..253980c 100755
--- a/hatta.py
+++ b/hatta.py
@@ -70,7 +70,7 @@ try:
except ImportError:
split_japanese = None
-__version__ = '1.3.0-dev'
+__version__ = '1.3.1'
def external_link(addr):
"""
@@ -605,6 +605,10 @@ class WikiParser(object):
...
>>> test(u"ziew")
<p id="line_0">ziew</p>
+ >>> test(u"d&d")
+ <p id="line_0">d&amp;d</p>
+ >>> test(u"= head =")
+ <a name="head-1"></a><h1 id="line_0">head</h1>
"""
bullets_pat = ur"^\s*[*]+\s+"
@@ -617,10 +621,10 @@ class WikiParser(object):
"bullets": bullets_pat,
"code": ur"^[{][{][{]+\s*$",
"conflict": ur"^<<<<<<< local\s*$",
- "macro": ur"^<<\w+\s*$",
"empty": ur"^\s*$",
"heading": heading_pat,
"indent": ur"^[ \t]+",
+ "macro": ur"^<<\w+\s*$",
"quote": quote_pat,
"rule": ur"^\s*---+\s*$",
"syntax": ur"^\{\{\{\#!\w+\s*$",
@@ -714,7 +718,16 @@ class WikiParser(object):
yield part
def parse_line(self, line):
- """Find all the line-level markup and return HTML for it."""
+ """
+ Find all the line-level markup and return HTML for it.
+
+ >>> import lxml.html.usedoctest
+ >>> parser = WikiParser([], None, None)
+ >>> print u''.join(parser.parse_line(u'some **bold** words'))
+ some <b>bold</b> words
+ >>> print u''.join(parser.parse_line(u'some **bold words'))
+ some <b>bold words
+ """
for m in self.markup_re.finditer(line):
func = getattr(self, "_line_%s" % m.lastgroup)
@@ -735,8 +748,6 @@ class WikiParser(object):
pass
return u"".join(u"</%s>" % tag for tag in tags)
-# methods for the markup inside lines:
-
def lines_until(self, close_re):
"""Get lines from input until the closing markup is encountered."""
@@ -745,6 +756,8 @@ class WikiParser(object):
yield line.rstrip()
line_no, line = self.enumerated_lines.next()
+# methods for the markup inside lines:
+
def _line_linebreak(self, groups):
return u'<br>'