Update of sr #109696 (project administration): Status: None => In Progress Assigned to: None => ineiev
_______________________________________________________ Follow-up Comment #1: First, we want to wrap those verbatim elements at reasonable width --- if they aren't, long lines break rendering of whole item. Then, it's desirable to make this work with CSS-unaware browsers as well. I'd rather reformat spaces using like this: function markup_verbatim_spaces ($ns) { if ($ns < 1) return ""; if ($ns < 2) return " "; $ret = " <span>"; $ns--; while ($ns) { $ns--; $ret .= ' '; } return $ret . "</span>"; } ... $verbatim_buffer = str_replace ("\r\n", "\n", $verbatim_buffer); $verbatim_buffer = str_replace ("\n\r", "\n", $verbatim_buffer); $verbatim_buffer = str_replace ("\r", "\n", $verbatim_buffer); # Hopefully preserve spaces in HTML allowing line breaking. $verb_out = ""; $ns = 0; for ($i = 0; $i < strlen ($verbatim_buffer); $i++) { $next_char = substr ($verbatim_buffer, $i, 1); if ($next_char === ' ') { $ns++; continue; } if ($ns) { $verb_out .= markup_verbatim_spaces ($ns); $ns = 0; } $verb_out .= $next_char; } $verbatim_buffer = $verb_out . markup_verbatim_spaces ($ns); $verbatim_buffer = str_replace ("\t", "<span> </span>\t", $verbatim_buffer); $verbatim_buffer = str_replace ("\n", "<br />\n", $verbatim_buffer); _______________________________________________________ Reply to this item at: <https://savannah.nongnu.org/support/?109696> _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/