New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Paragraphs are not stripped but turn into line-breaks #80
Comments
Those linebreaks are newline characters (i.e. FWIW, newline characters in We have debated if SEOMate should replace closing/opening paragraph tags with literal spaces, but so far we've opted to just keep the newlines and avoid the potential edge cases involved in doing that. That said, at this point Redactor isn't the only field type outputting rich text, and it's not even the recommended, first party one anymore. I took a look at CKEditor, and it turns out that CK doesn't produce the newlines after paragraphs... which means that if a CKEditor field is used for SEOMate metadata, paragraphs will be joined together without spaces – which IMO is a bigger problem than Redactor fields having newlines retained. But in any case, perhaps it's time to revisit the problem and figure out a solution that works well for any and all rich text field types. TL;DR – maybe the best call after all, is if SEOMate a) removes any newlines and b) adds a literal space between stripped paragraphs. |
Thanks for clarifying! And you are right, as it turns out, the I was able to work around this by adding something like this to 'tagTemplateMap' => [
'title' => '<title>{{ value|replace({"\n": "", "\r": ""}) }}</title>',
] |
We've decided to address this by replacing all control characters (including newlines) by a literal space. This change will be in the next SEOMate release. |
SEOMate v. 2.2.0 is out now with this change. |
When SEOMate outputs
<title>
and<meta desc>
, tags like<br>
,<strong>
, '<em>
, ... are properly stripped.Paragraphs, however, turn into line-breaks, both for
<title>
and<meta desc>
.This is particularly problematic when using a rich text fields.
Example
Content of variable
altTitle
(a rich text field):outputs
config/SEOMate.php
The text was updated successfully, but these errors were encountered: