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

Validation error raised when validating post with Schema.org script added by All In One SEO #4420

Closed
westonruter opened this issue Mar 23, 2020 · 2 comments · Fixed by #4428
Labels
Bug Something isn't working Validation
Milestone

Comments

@westonruter
Copy link
Member

Bug Description

Originally reported in the support forum. When the All in One SEO Pack plugin is active and you view a single post, you'll see that there is no validation error in the admin bar. However, once you click to Validate then you'll see a validation error reported:

image

The problem is that source stack comments are erroneously getting injected into the script.

Expected Behaviour

Comments should be stripped from JSON scripts when validating.

Steps to reproduce

  1. Activate AIOSEO plugin.
  2. Enable Standard mode or Transitional mode in the AMP plugin.
  3. View a single post in AMP.
  4. Notice no validation error appears in the admin bar.
  5. Click the validate link, and now see a validation error reported.

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

Implementation brief

QA testing instructions

Demo

Changelog entry

@westonruter westonruter added Bug Something isn't working Validation labels Mar 23, 2020
@westonruter
Copy link
Member Author

Here is a temporary workaround mini plugin: https://gist.github.com/westonruter/5d66967fe586fb64d7244d3ad0dc89cb

@westonruter
Copy link
Member Author

Given that <!-- appearing anywhere in JSON is also a validation error, the fix here could be also to encode such hyphens as escape sequences. This would prevent issues like #3935 from occurring. Nevertheless, comments as a whole should also be removed to account for source stack comments being injected during validation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Validation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant