markty-TOML icon indicating copy to clipboard operation
markty-TOML copied to clipboard

Comments break tables

Open venashial opened this issue 2 years ago • 0 comments

A comment on the same line of a table declaration cause the table to be ignored.

Reproduction

import toml from 'markty-toml';

const someTOML = `
key = "value"
 
[table] # Comment...
nested = "123" 
`;

console.log(toml(someTOML));

↳ returns ↴

{ key: 'value' }

Removing the comment in the above example causes the parser to return the correct value.

venashial avatar Jul 27 '22 00:07 venashial