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

HTMLHint JSON output can be invalid #7

Closed
jh409 opened this issue Sep 2, 2016 · 2 comments
Closed

HTMLHint JSON output can be invalid #7

jh409 opened this issue Sep 2, 2016 · 2 comments

Comments

@jh409
Copy link

jh409 commented Sep 2, 2016

Hi,

I currently have an issue where the HTML reporter is producing invalid JSON when the offending HTML is on a new line.

For example, this HTML:

<button class="cancelButton"
onclick="return false;">Cancel</button>

produces this invalid JSON in the report:

{
"line": 62,
"message": "Inline script [
onclick = 'return false;'] cannot be use.",
"description": "Inline script cannot be use.",
"rulekey": "inline-script-disabled",
"severity": "MINOR",
"reporter": "htmlhint",
"creationDate": 1472831618394
}

I'm also using your frontend plugin, which then throws an exception when it tries to parse this JSON.

I realise that this is due to the handling of the message in HTMLHint rule itself, but I don't think that's trying to create JSON, whereas the HTML reporter here is, hence why I'm reporting it here.

If you think it's an issue with the original HTMLHint, I will report it there instead.

@cedric-legallo
Copy link
Contributor

Hi, this issues was fixed a fex time ago by this commit :
2d57cea

but this version is not on npm at the moment.
I'll fix that today

@jh409
Copy link
Author

jh409 commented Sep 12, 2016

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants