Hupl icon indicating copy to clipboard operation
Hupl copied to clipboard

Remove extra escaped slashes

Open gpopesc opened this issue 10 months ago • 5 comments

This is not a bug, it is more an enhancement.

My response from server is like: {"message":"OK","version":"3.6.0","url":"https:\/\/example.com\/retu3\/sepEFoDu65.jpg"}

I added regex in your app: "url":"([^"]+)", then the final link is like: https:\/\/example.com\/retu3\/sepEFoDu65.jpg Question: how i get rid of escaped slashes in order to have an usable link? Can you add a further replacement function ?

Thank you Gabriel

gpopesc avatar Mar 13 '25 13:03 gpopesc

what escaped slashes?

Rouji avatar Mar 13 '25 13:03 Rouji

I edited my initial post. Now you can see the escaped slashes

gpopesc avatar Mar 13 '25 14:03 gpopesc

why are there backslashes in it? slashes don't need to be escaped in json(?)

yes it'd need new functionality in the app for filtering, but I have no idea when I have time to look into that. PRs always welcome

Rouji avatar Mar 13 '25 16:03 Rouji

A JSON response format doesn't seem unusual, so perhaps a better idea would be implementing a JSON parser and allowing the user to specify which field the resulting URL is conveyed in. Suggested config name: responseJsonPath, alternatively also adding "Url" in there but since it's not in responseRegex either I'd go for consistency.

FichteFoll avatar Mar 15 '25 12:03 FichteFoll

oh that's true, a json parser would probably (hopefully) unescape that. even if it didn't need to be escaped in the first place

again PRs welcome

Rouji avatar Mar 16 '25 00:03 Rouji