Skip to content

Quotes are not stripped from escaped property values when inline comments are present #89

@lpd-au

Description

@lpd-au

Ini property values may be quoted to escape special characters and indicate they are strings. However, comments following a quoted property value force the quotes to appear literally in the output.

Test Case

const ini = require('ini');

console.log(ini.decode('a.b = "c"'));
console.log(ini.decode('a.b = "c" ; asdf'));
console.log(ini.decode('a.b = c ; asdf'));

Expected Output

{ 'a.b': 'c' }
{ 'a.b': 'c' }
{ 'a.b': 'c' }
=> undefined

Actual Output

{ 'a.b': 'c' }
{ 'a.b': '"c"' }
{ 'a.b': 'c' }
=> undefined

This issue relates to: #81.

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