Closed GoogleCodeExporter closed 8 years ago
I apologize for the issue showing up as a Defect, I did not see any way to
change to Enhancement request.
Original comment by kusinw...@gmail.com
on 3 Feb 2011 at 9:45
Seems like a good idea. Have you been using your patch for a while? Any issues?
Original comment by willmcgugan
on 4 Dec 2011 at 9:44
Howdy,
I have been using my patch since I posted. It works wonderfully, I haven't made
any changes to that code since the post.
I apologize in advance if anything below has already been addressed or will not
be worked on, but these are my experiences and fixes over the course of this
year of using the module, last updated when I downloaded in February.
I did how ever find a bug with the [color] tag, if you have
"[color=red]Something[color]" and forget to put the "/" in, you will get an
exception of
"IndexError: list index out of range
color = self.params.split()[0:1][0].lower()"
I fixed this bug by checking for content in self.params first and if nothing is
there, just return nothing.
@@ -561,20 +542,21 @@
TagBase.__init__(self, name, inline=True)
def render_open(self, parser, node_index):
-
+ # They may have entered [color] instead of [/color]
+ if not self.params:
+ self.color = None
+ return u""
+
valid_chars = self.valid_chars
color = self.params.split()[0:1][0].lower()
self.color = "".join([c for c in color if c in valid_chars])
-
- if not self.color:
- return u""
-
+
return u'<span style="color:%s">' % self.color
def render_close(self, parser, node_index):
-
if not self.color:
return u''
+
return u'</span>'
I also made a number of other changes, such as I walked through every line of
code explicitly noting each string is unicode to speed up the module. I ran the
entire module through profiler and found the conversion from a non-unicode
string to unicode was expensive and happen often.
The tokenizer was the largest change I made, this was to fix the assumption of
"[" and/or "]" were for the postmarkup module exclusively. Much of the text I
run through the module tends to have brackets for various reasons.
If you are interested in seeing my changes in detail, please contact me at
kusinwolf@gmail.com and I will provide those changes via diff. Also, I have
provided full credit of the module in the headers to you, siting this project
for the work. :)
Original comment by kusinw...@gmail.com
on 16 Dec 2011 at 5:05
The color tag was fixed. At least I can't reproduce the problem.
Not sure what your changes regarding square brackets do. Postmarkup will allow
square brackets though unmodified if they are not part of a tag. e.g.
"[b]:-][/b]" works fine.
I think you may have been working with a rather old version, but I would like
to see your patch! I'll fire off an email.
Original comment by willmcgugan
on 16 Dec 2011 at 5:15
Cleaning up old bugs. Will accept a patch against the current version if you
have it...
Original comment by willmcgugan
on 18 Nov 2012 at 5:08
Original issue reported on code.google.com by
kusinw...@gmail.com
on 3 Feb 2011 at 9:45