Subject: | [PATCH] need to escape colons in definition lists |
I was trying out pod2wiki with my MSDOS::Descript module's docs, and my
class method got messed up. The problem turned out to be that in
wikipedia format the colon ended the term being defined and started the
definition. This is a problem when the term being defined contains
colons (like MSDOS::Descript).
The solution I found was to patch _handle_text to convert colons to HTML
entities when we're inside an item_text event. I've only done this for
wikipedia format, although it wouldn't surprise me if other formats
required something similar.
Other than that, pod2wiki seems to work fairly well. Thanks.
Subject: | colon.patch |
--- Wiki.pm Tue Jan 30 17:50:10 2007
+++ Wiki.pm Wed Jan 31 15:52:20 2007
@@ -441,6 +441,11 @@
return;
}
+ # Escape colons in wikipedia definition lists:
+ if ($self->{_format} eq 'wikipedia' and $self->{_in_item_text}) {
+ $text =~ s/:/:/g; # A colon would end the item
+ }
+
# Split the text into tokens but maintain the whitespace
my @tokens = split /(\s+)/, $text;