-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
Describe the bug
A parse result for number list with non-plain text is inconsistent to one with plain text.
1. foo
2. [* bar]
3. `baz`
Scrapbox text above will be parsed as below:
[
{
indent: 1,
type: "line",
nodes: [
{
type: "numberList",
raw: "1. foo",
rawNumber: "1",
number: 1,
nodes: [ [Object] ]
}
]
},
{
indent: 1,
type: "line",
nodes: [
{
type: "numberList",
raw: "2. ",
rawNumber: "2",
number: 2,
nodes: [] // no child nodes!
},
{
type: "decoration",
raw: "[* bar]",
// etc.
}
]
},
{
indent: 1,
type: "line",
nodes: [
{
type: "numberList",
raw: "3. ",
rawNumber: "3",
number: 3,
nodes: [] // no child nodes!
},
{ type: "code", raw: "`baz`", text: "baz" }
]
}
]
2nd and 3rd numberList
node doesn't have child nodes, while 1st has.
To Reproduce
Steps to reproduce the behavior:
console.log(parse(
` 1. foo
2. [* bar]
3. \`baz\``,
{ hasTitle: false },
));
Expected behavior
All numberList
node have appropriate children nodes.
Metadata
Metadata
Assignees
Labels
No labels