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

Bad escape sequence in string #78

Closed
cmpsoares91 opened this issue Feb 17, 2020 · 4 comments · Fixed by #148
Closed

Bad escape sequence in string #78

cmpsoares91 opened this issue Feb 17, 2020 · 4 comments · Fixed by #148
Labels
bug Something isn't working

Comments

@cmpsoares91
Copy link
Contributor

Hello,

I'm using this theme recently for my Hugo blog but in the home page ( https://www.cmpsoares.com ) I keep getting the following error from the google search console: Bad escape sequence in string

I'm quite new to all this scheme.org stuff so could someone enlighten and help me, please?

Kind regards,
Carlos Soares.

@dillonzq dillonzq added the bug Something isn't working label Feb 18, 2020
@dillonzq
Copy link
Owner

Hi, @cmpsoares91
For some reason of Hugo, & in the content won't be escaped as &.
I have fixed & of the subtitle in the home page in #79 .
But I can't fix the behavior of hugo --minify, which replaces some & with & leading to the invalid HTML checking.
Could you show more error information from the google search console?

@cmpsoares91
Copy link
Contributor Author

cmpsoares91 commented Feb 27, 2020

Hello @dillonzq ,

Sorry for the delayed reply.

I've been looking further into it, and it seems that the template or Hugo itself is modifying the string in the page scheme to hexadecimal ASCII and Google says that their scheme parser is unable to parse it... more specifically the error: "Bad escape sequence in string".

So for the apostrophe example: it is expecting \' instead of \x27 and it happens on other similar occasions.

As is the example of: "datePublished":"2019-03-26T07:31:58\x2b00:00","dateModified":"2020-02-26T03:47:06\x2b00:00"

Many thanks,
Carlos Manuel Soares.

@cmpsoares91
Copy link
Contributor Author

cmpsoares91 commented Feb 27, 2020

Hello @dillonzq ,

I think I might have a fix for you. But I need to wait for Google's re-index to be sure.
If it confirms the fix, I'll create a PR for you to validate.

So, I'll keep you posted.

Many thanks,
Carlos Manuel Soares.

@cmpsoares91
Copy link
Contributor Author

Nice thanks! Going to test this version!

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

Successfully merging a pull request may close this issue.

2 participants