Skip to content
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

JSON-LD: Remove quotes in headlines & descriptions #569

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

tomschr
Copy link
Collaborator

@tomschr tomschr commented Aug 11, 2023

Problem

If a text contains "quotes", this text will create a syntax error for JSON. Either the quotes need to be masked or removed. I decided to remove them with translate().

First discovered for /de-de/sles/15-SP1/html/SLES-all/cha-apache2.html.

Solution

This PR adds the XPath function translate() to remove and quotes. Although this is not entirely accurate, it's probably the easiest and fastest solution.

If a text contains "quotes", this text will create a syntax error
for JSON. Either the quotes need to be masked or removed.
I decided to remove them with translate().
@tomschr tomschr added cat-bug Malfunction, unexpected behavior format-html html, xhtml, html5, webhelp, jsp support styles-2022 "suse2022-ns" styles topic-seo All about search engine optimization labels Aug 11, 2023
@tomschr tomschr self-assigned this Aug 11, 2023
@tomschr tomschr marked this pull request as ready for review August 14, 2023 09:13
@tomschr tomschr merged commit 1323858 into main Aug 14, 2023
@tomschr tomschr deleted the json-ld-fix-quotes-in-text branch August 14, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat-bug Malfunction, unexpected behavior format-html html, xhtml, html5, webhelp, jsp support styles-2022 "suse2022-ns" styles topic-seo All about search engine optimization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant