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

Json.Decoder.string doesn't support escaped double quotes #716

Closed
matasar opened this Issue Sep 21, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@matasar

matasar commented Sep 21, 2016

Elm version: 0.17.1
Browsers: Safari, Chrome, Firefox

I made a simple test case to show what I mean. Based on the error, it seems like it might be not treating the quotation mark as escaped. I tried \x22 and see the same error as well.

import Json.Decode exposing (..)
import Html exposing (text)

errorCase = """
"escaped quote: \"."
"""

value = decodeString string errorCase
main = Html.text <| toString value

I'm very new to Elm, so I might be doing something obviously stupid with Elm, but using \ to escape double quotes is legal Json as far as such a thing exists.

Update: As I play with this more, I think the problem isn't with JSON at all but is that the """ for multiline strings has escaping behavior I didn't expect.

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Sep 21, 2016

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Sep 21, 2016

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment