You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have HTML (created by WYSIWYG editors) that contain <strong> tags with <br /> tags inside. Because the <br /> tags are converted to new lines before <strong> is being converted to uppercase, and the regexp doesn't match new lines, it prevents the <strong> from being converted to uppercase.
Example: <strong>This would<br />not be converted.</strong><strong>But this would, though</strong>
Because not all <strong> tags have a <br /> it's kind of confusing for our users. This could also be the case for more tags ofcourse (<b>, <a>, ...)
Using character classes. Use [\s\S] instead of . (dot). This would match all characters that are spaces and all characters that are not spaces. In other words, any character, including line breaks. This still gives you the ability to use the . (dot) for it's actual purpose. Not necessary in this case, but giving the option anyways :)
We have HTML (created by WYSIWYG editors) that contain
<strong>
tags with<br />
tags inside. Because the<br />
tags are converted to new lines before<strong>
is being converted to uppercase, and the regexp doesn't match new lines, it prevents the<strong>
from being converted to uppercase.Example:
<strong>This would<br />not be converted.</strong><strong>But this would, though</strong>
Because not all
<strong>
tags have a<br />
it's kind of confusing for our users. This could also be the case for more tags ofcourse (<b>
,<a>
, ...)There could be 3 solutions:
s
pattern modifier to the regexp (http://php.net/manual/en/reference.pcre.pattern.modifiers.php). This would cause all dots to match line breaks.[\s\S]
instead of.
(dot). This would match all characters that are spaces and all characters that are not spaces. In other words, any character, including line breaks. This still gives you the ability to use the.
(dot) for it's actual purpose. Not necessary in this case, but giving the option anyways :)<br />
to the end of the array, so<br />
would be converted last.The text was updated successfully, but these errors were encountered: