Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use P instead of double-BR for plaintext mode
  • Loading branch information
pudge committed Jun 6, 2008
1 parent a1ee88f commit c8f692f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Slash/Utility/Data/Data.pm
Expand Up @@ -1206,6 +1206,15 @@ my %actions = (
# Preserve leading indents / spaces
# can mess up internal tabs, oh well
${$_[0]} =~ s/\t/ /g; },
paragraph_wrap => sub {
# start off the text with a <p>!
${$_[0]} = '<p>' . ${$_[0]} unless ${$_[0]} =~ /^\s*<p>/s;
# this doesn't assume there will be only two BRs,
# but it does come after whitespace_tagify, so
# chances are, will be only two BRs in a row
${$_[0]} =~ s/(?:<br>){2}/<p>/g;
# make sure we don't end with a <br><p> or <br>
${$_[0]} =~ s/<br>(<p>|$)/$1/g; },
whitespace_and_tt => sub {
${$_[0]} =~ s{((?: )+)(?: (\S))?} {
("&nbsp; " x (length($1)/2)) .
Expand Down Expand Up @@ -1287,7 +1296,8 @@ my %mode_actions = (
approveCharrefs
breakHtml_ifwhitefix
whitespace_tagify
newline_indent )],
newline_indent
paragraph_wrap )],
HTML, [qw(
newline_to_local
trailing_whitespace
Expand Down

0 comments on commit c8f692f

Please sign in to comment.