Implement FAQ structured data in default.tpl#335
Implement FAQ structured data in default.tpl#335iamadlx wants to merge 2 commits intoPrestaSafe:mainfrom
Conversation
Added JSON-LD structured data for FAQ rich snippets.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f0a2a6612
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "name": "{$faq.question|strip_tags|escape:'htmlall':'UTF-8'}", | ||
| "acceptedAnswer": {literal}{{/literal} | ||
| "@type": "Answer", | ||
| "text": "{$faq.answer|strip_tags|escape:'htmlall':'UTF-8'}" |
There was a problem hiding this comment.
Escape FAQ values with JSON-safe encoding
The structured data strings are escaped with escape:'htmlall', which is HTML escaping rather than JSON escaping. This can emit invalid JSON when FAQ content includes JSON-significant characters (for example a backslash in C:\Temp or control characters), causing the application/ld+json block to fail parsing and preventing FAQ rich results from being recognized.
Useful? React with 👍 / 👎.
Added JSON-LD structured data for FAQ rich snippets.