Add zero width space characters to plugin output where appropriate
This helps browsers to break lines if the plugin output is missing whitespaces. Alternatively we could set word-break: break-all but that may produce ugly results. refs #10820
This commit is contained in:
parent
16cc5e333a
commit
1f7a4a170f
|
@ -51,6 +51,14 @@ class Zend_View_Helper_PluginOutput extends Zend_View_Helper_Abstract
|
|||
$isHtml = false;
|
||||
}
|
||||
$output = $this->fixLinks($output);
|
||||
// Help browsers to break words in plugin output
|
||||
$output = trim($output);
|
||||
// Add space after comma where missing
|
||||
$output = preg_replace('/,[^\s]/', ', ', $output);
|
||||
// Add zero width space after ')', ']', ':', '.', '_' and '-' if not surrounded by whitespaces
|
||||
$output = preg_replace('/([^\s])([\\)\\]:._-])([^\s])/', '$1$2​$3', $output);
|
||||
// Add zero width space before '(' and '[' if not surrounded by whitespaces
|
||||
$output = preg_replace('/([^\s])([([])([^\s])/', '$1​$2$3', $output);
|
||||
|
||||
if (! $raw) {
|
||||
if ($isHtml) {
|
||||
|
|
Loading…
Reference in New Issue