brotkrueml / schema

TYPO3 extension providing an API and view helpers for schema.org markup

Home Page:https://extensions.typo3.org/extension/schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

newline in meta description results in an error

ste101 opened this issue · comments

If the is a newline in meta description this error will be shown in HTML:
Decoding the string to json didn't result in a array. Please check if 'decodeOptions', 'addSlashes' and 'stripSlashes' should be further specified.

@ste101 Can you give a scenario, how this error can be reproduced? I set the meta description of a page to a multi-line text and added this in a Fluid template:

<schema:type.thing description="{data.description}"/>

Also with PHP:

$type->setProperty('description', "some text\nanother text");

But everything is fine.

Sorry I wasn't accurate enough, a newline in the page meta tag description field.

I don't get the error with version 1.12.0 and master. This is my description:

image

This the resulting markup:

{"@type":"Thing","description":"Some\r\n\r\ndescription"}

No error on website level and no error on validation level (validator.schema.org).

Are you sure the new line is the problem? Perhaps you have other characters in the string (maybe not visible) which throws the error.

What is your actual code to generate the markup? Can you provide an example (with text)?

Sorry, my fault. It was a problem of another extension.