X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=encode.php;h=fd282b75af7754ebc62e98f93927f17239791c08;hb=414082e3e11cee010f869633733eccb4f2161153;hp=ca4a9191b39587f51296289ffeabb184bd6f732d;hpb=2166a8d5fbcc100ae21ed36e10359eb8856372f7;p=wfpl.git
diff --git a/encode.php b/encode.php
index ca4a919..fd282b7 100644
--- a/encode.php
+++ b/encode.php
@@ -74,7 +74,7 @@ function enc_htmlbr($str) {
# Example:
~foo htmlbrtab~
function enc_htmlbrtab($str) {
$str = enc_htmlbr($str);
- $whitespace_to_nbsp = create_function('$matches', '$count = 0; $chars = str_split($matches[0]); foreach ($chars as $c) { if ($c == " ") { $count += 2; } else if ($c == "\t") { $count += 8; } } return str_repeat(" ", $count);');
+ $whitespace_to_nbsp = create_function('$matches', '$count = 0; $chars = str_split($matches[0]); foreach ($chars as $c) { if ($c == " ") { $count += 1; } else if ($c == "\t") { $count += 8; } } return str_repeat(" ", $count);');
$str = preg_replace_callback("|^[ \t]+|m", $whitespace_to_nbsp, $str);
return $str;
}
@@ -268,7 +268,7 @@ function pulldown($name, $in_options, $multiple = false) {
# output a bunch of