Skip to content

Escaped backslash before quote #15

@derek-miller

Description

@derek-miller

It appears the logic for when to respect a quote vs an escaped quote does not consider if the preceding escape char is itself escaped. For example:

$ node
Welcome to Node.js v12.3.1.
Type ".help" for more information.
> const split = require('split-string')
undefined
> console.log(split('\\\\"hello world\\\\"', { separator: ' ', quotes: ['"'] }))
[ '\\\\"hello', 'world\\\\"' ]
undefined
>

I would expect this to be [ '\\\\"hello world\\\\"' ].

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions