Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: undefined glyphType and nested lists #5

Merged
merged 6 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 15 additions & 5 deletions e2e/__html__/complete.json.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,22 @@ <h1 class="heading-1" id="paragraph-styles">Paragraph styles</h1>
Bordered paragraph
</p>
<h1 style="text-align: justify" class="heading-1" id="lists">Lists</h1>
<ol class="nesting-level-1">
<li>Unordered list bullet</li>
<li>Nested unordered list bullet</li>
<ul class="nesting-level-1">
<li>
Unordered list bullet
<ul class="nesting-level-2">
<li>Nested unordered list bullet</li>
</ul>
</li>
<li>Another list bullet</li>
<li>Ordered listed bullet</li>
<li>Nested ordered list bullet</li>
</ul>
<ol class="nesting-level-1" list-style-type="decimal">
<li>
Ordered listed bullet
<ol class="nesting-level-2" list-style-type="lower-alpha">
<li>Nested ordered list bullet</li>
</ol>
</li>
<li>Another list bullet</li>
</ol>
<h1 style="text-align: justify" class="heading-1" id="tables">Tables</h1>
Expand Down
20 changes: 15 additions & 5 deletions e2e/__html__/complete.json_styles_false.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,22 @@ <h1 class="heading-1" id="paragraph-styles">Paragraph styles</h1>
<p class="normal-text">Indented</p>
<p class="normal-text">Bordered paragraph</p>
<h1 class="heading-1" id="lists">Lists</h1>
<ol class="nesting-level-1">
<li>Unordered list bullet</li>
<li>Nested unordered list bullet</li>
<ul class="nesting-level-1">
<li>
Unordered list bullet
<ul class="nesting-level-2">
<li>Nested unordered list bullet</li>
</ul>
</li>
<li>Another list bullet</li>
<li>Ordered listed bullet</li>
<li>Nested ordered list bullet</li>
</ul>
<ol class="nesting-level-1" list-style-type="decimal">
<li>
Ordered listed bullet
<ol class="nesting-level-2" list-style-type="lower-alpha">
<li>Nested ordered list bullet</li>
</ol>
</li>
<li>Another list bullet</li>
</ol>
<h1 class="heading-1" id="tables">Tables</h1>
Expand Down
158 changes: 114 additions & 44 deletions e2e/__snapshots__/hast.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ exports[`%name { name: 'complete.json' } > hast 1`] = `
},
{
"type": "element",
"tagName": "ol",
"tagName": "ul",
"properties": {
"className": [
"nesting-level-1"
Expand All @@ -732,17 +732,28 @@ exports[`%name { name: 'complete.json' } > hast 1`] = `
{
"type": "text",
"value": "Unordered list bullet"
}
]
},
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
},
{
"type": "text",
"value": "Nested unordered list bullet"
"type": "element",
"tagName": "ul",
"properties": {
"className": [
"nesting-level-2"
]
},
"children": [
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
{
"type": "text",
"value": "Nested unordered list bullet"
}
]
}
]
}
]
},
Expand All @@ -756,7 +767,19 @@ exports[`%name { name: 'complete.json' } > hast 1`] = `
"value": "Another list bullet"
}
]
},
}
]
},
{
"type": "element",
"tagName": "ol",
"properties": {
"className": [
"nesting-level-1"
],
"list-style-type": "decimal"
},
"children": [
{
"type": "element",
"tagName": "li",
Expand All @@ -765,17 +788,29 @@ exports[`%name { name: 'complete.json' } > hast 1`] = `
{
"type": "text",
"value": "Ordered listed bullet"
}
]
},
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
},
{
"type": "text",
"value": "Nested ordered list bullet"
"type": "element",
"tagName": "ol",
"properties": {
"className": [
"nesting-level-2"
],
"list-style-type": "lower-alpha"
},
"children": [
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
{
"type": "text",
"value": "Nested ordered list bullet"
}
]
}
]
}
]
},
Expand Down Expand Up @@ -2936,7 +2971,7 @@ exports[`%name { name: 'complete.json' } > hast without styles 1`] = `
},
{
"type": "element",
"tagName": "ol",
"tagName": "ul",
"properties": {
"className": [
"nesting-level-1"
Expand All @@ -2951,17 +2986,28 @@ exports[`%name { name: 'complete.json' } > hast without styles 1`] = `
{
"type": "text",
"value": "Unordered list bullet"
}
]
},
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
},
{
"type": "text",
"value": "Nested unordered list bullet"
"type": "element",
"tagName": "ul",
"properties": {
"className": [
"nesting-level-2"
]
},
"children": [
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
{
"type": "text",
"value": "Nested unordered list bullet"
}
]
}
]
}
]
},
Expand All @@ -2975,7 +3021,19 @@ exports[`%name { name: 'complete.json' } > hast without styles 1`] = `
"value": "Another list bullet"
}
]
},
}
]
},
{
"type": "element",
"tagName": "ol",
"properties": {
"className": [
"nesting-level-1"
],
"list-style-type": "decimal"
},
"children": [
{
"type": "element",
"tagName": "li",
Expand All @@ -2984,17 +3042,29 @@ exports[`%name { name: 'complete.json' } > hast without styles 1`] = `
{
"type": "text",
"value": "Ordered listed bullet"
}
]
},
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
},
{
"type": "text",
"value": "Nested ordered list bullet"
"type": "element",
"tagName": "ol",
"properties": {
"className": [
"nesting-level-2"
],
"list-style-type": "lower-alpha"
},
"children": [
{
"type": "element",
"tagName": "li",
"properties": {},
"children": [
{
"type": "text",
"value": "Nested ordered list bullet"
}
]
}
]
}
]
},
Expand Down
40 changes: 30 additions & 10 deletions e2e/__snapshots__/html.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,22 @@ exports[`%name { name: 'complete.json' } > html 1`] = `
Bordered paragraph
</p>
<h1 style="text-align: justify" class="heading-1" id="lists">Lists</h1>
<ol class="nesting-level-1">
<li>Unordered list bullet</li>
<li>Nested unordered list bullet</li>
<ul class="nesting-level-1">
<li>
Unordered list bullet
<ul class="nesting-level-2">
<li>Nested unordered list bullet</li>
</ul>
</li>
<li>Another list bullet</li>
<li>Ordered listed bullet</li>
<li>Nested ordered list bullet</li>
</ul>
<ol class="nesting-level-1" list-style-type="decimal">
<li>
Ordered listed bullet
<ol class="nesting-level-2" list-style-type="lower-alpha">
<li>Nested ordered list bullet</li>
</ol>
</li>
<li>Another list bullet</li>
</ol>
<h1 style="text-align: justify" class="heading-1" id="tables">Tables</h1>
Expand Down Expand Up @@ -535,12 +545,22 @@ exports[`%name { name: 'complete.json' } > html without styles 1`] = `
<p class="normal-text">Indented</p>
<p class="normal-text">Bordered paragraph</p>
<h1 class="heading-1" id="lists">Lists</h1>
<ol class="nesting-level-1">
<li>Unordered list bullet</li>
<li>Nested unordered list bullet</li>
<ul class="nesting-level-1">
<li>
Unordered list bullet
<ul class="nesting-level-2">
<li>Nested unordered list bullet</li>
</ul>
</li>
<li>Another list bullet</li>
<li>Ordered listed bullet</li>
<li>Nested ordered list bullet</li>
</ul>
<ol class="nesting-level-1" list-style-type="decimal">
<li>
Ordered listed bullet
<ol class="nesting-level-2" list-style-type="lower-alpha">
<li>Nested ordered list bullet</li>
</ol>
</li>
<li>Another list bullet</li>
</ol>
<h1 class="heading-1" id="tables">Tables</h1>
Expand Down