-
Notifications
You must be signed in to change notification settings - Fork 445
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
Fix broken links in JSON responses #620
Conversation
Links inside the a JSON response are not displayed properly because JSON encodes strings. This fix displays the original url but the underlying link is using the parsed string as the link `href` property.
When changing URLs into links, check contentType before attempting to JSON.parse
@jackbravo Merged thanks |
@jackbravo you can try the latest version 0.24.2 |
sorry 我没编辑好,我想写的是一个 img {
"test": "<img src=\"https://shenzhen.aliyuncs.com/aaa/201903/2019032614/file_aaa.jpg\" title=\"\" alt=\"\"/>"
} |
@tangdw the response body you've provided is not JSON actually
|
Indeed, that is not json, it needs " surrounding both the key and the value. On the other hand, the new release is working great for me with links on json. Thanks @Huachao ! |
@jackbravo @tangdw I got the root cause since @jackbravo will try to JSON parse the links of JSON mime type, here so I think we can simply revert the change and the issue in #676 will be solved. @jackbravo as for your case, I forgot that we already have a setting to handle the escape issue, so you just need to set |
😮 ! Didn't know about that option. But should work as well. |
Links inside the a JSON response are not displayed properly because JSON encodes strings.
This fix displays the original url but the underlying link is using the parsed string as the link
href
property.This is an example JSON response that has this problem:
The parsed link should be
https://example.com/auth?reg_code=XLMKJDK&mso_id=ATT
.