Skip to content

Unexpected behavior of $mol_tree2_to_json #649

Open
@blokhin

Description

@blokhin

I observe strange behavior of $mol_tree2_to_json using node v18.14.0. The tree ref implementation was installed with npm i mol_tree2.

This produces an empty string (expected JSON):

console.log(
	Tree.$mol_tree2_to_json(
		Tree.$mol_tree2_from_string(`
	foo
		bar
		lol
	hello \world
`)
	)
);

This yields an error Error: Unknown json type (article) (expected JSON):

console.log(
	Tree.$mol_tree2_to_json(
		Tree.$mol_tree2_from_string(`
article
	title \Hello world
	description
		\This is demo of tree-format
		\Cool! Is not it? :-)
`)
	)
);

However in both these cases $mol_tree2_from_string produces valid $mol_tree2 object.

What am I doing wrong here?

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