Skip to content

Multiline value parsing issue #268

Open

Description

@igu-ru

If a JSON value contain multiple lines and looks like {"description": "A\r\nB"}, its value is expected to be parse to the string "A" & vbCr & vbLf & "B". In fact it converts to "A" & vbCr & vbCr & vbLf & "B" (doubled vbCr's).

To fix this, I suggest modify the json_ParseString function:

...
        Case json_Quote
            json_ParseString = json_BufferToString(json_Buffer, json_BufferPosition)
            json_ParseString = VBA.Replace(json_ParseString, VBA.vbCr & VBA.vbCr, VBA.vbCr) ' Fix \r\r\n -> \r\n
            json_Index = json_Index + 1
            Exit Function
...

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions