Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

Post content encoding issue for single quote #303

Closed
bmoers opened this issue Sep 28, 2018 · 1 comment
Closed

Post content encoding issue for single quote #303

bmoers opened this issue Sep 28, 2018 · 1 comment
Labels

Comments

@bmoers
Copy link

bmoers commented Sep 28, 2018

I'm posting the comments to a REST API in this format:

{
    "action": "${PULL_REQUEST_ACTION}",
    "comment": "${PULL_REQUEST_COMMENT_TEXT}"
}

(the "Post content variables encoding" is set to "Encode as HTML")
If the comment contains single quotes the encoding is ' which causes the JSON parser to fail as it is invalid JSON.

eg

{
	"action": "COMMENTED",
	"comment": "will it parse? \' "
}

it works as expected for double quotes

{
	"action": "COMMENTED",
	"comment": "So ignore if this is "OOB" :monkey:"
}

Any chance to fix this in the plugin?
(I'm currently parsing the raw body for this pattern and replace the related escape chars)

@tomasbjerre
Copy link
Owner

I released 3.23 now. It should have an encoding option for JSON. Open issue again if not working!

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

No branches or pull requests

2 participants