-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add tests for elements nested in a list item (#176) * Backport fix for element nested in numbered list * Fix list prefix for footnotes * Try to get link anchor before using open to open it --------- Co-authored-by: Lucas Timmins <timmins.s.lucas@gmail.com> --------- Co-authored-by: Lucas Timmins <timmins.s.lucas@gmail.com>
- Loading branch information
1 parent
0ce0297
commit 9956692
Showing
6 changed files
with
219 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
src/interpreter/snapshots/inlyne__interpreter__tests__code_in_ordered_list.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
source: src/interpreter/tests.rs | ||
expression: interpret_md(text) | ||
--- | ||
[ | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "1. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "1st item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
background_color: Some(Color { r: 0.86, g: 0.88, b: 0.91 }), | ||
is_code_block: true, | ||
texts: [ | ||
Text { | ||
text: "fn ", | ||
size: 18.0, | ||
color: Some(Color { r: 0.46, g: 0.27, b: 0.42 }), | ||
.. | ||
}, | ||
Text { | ||
text: "main", | ||
size: 18.0, | ||
color: Some(Color { r: 0.27, g: 0.36, b: 0.45 }), | ||
.. | ||
}, | ||
Text { | ||
text: "() {}", | ||
size: 18.0, | ||
color: Some(Color { r: 0.08, g: 0.10, b: 0.13 }), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "2. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "2nd item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
] |
70 changes: 70 additions & 0 deletions
70
src/interpreter/snapshots/inlyne__interpreter__tests__para_in_ordered_list.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
--- | ||
source: src/interpreter/tests.rs | ||
description: " --- md\n\n1. 1st item\n\n Nested paragraph\n\n2. 2nd item\n\n\n --- html\n\n<ol>\n<li>\n<p>1st item</p>\n<p>Nested paragraph</p>\n</li>\n<li>\n<p>2nd item</p>\n</li>\n</ol>\n" | ||
expression: interpret_md(text) | ||
--- | ||
[ | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "1. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "1st item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "Nested paragraph", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
TextBox( | ||
TextBox { | ||
indent: 50.0, | ||
texts: [ | ||
Text { | ||
text: "2. ", | ||
default_color: Color(BLACK), | ||
style: BOLD , | ||
.. | ||
}, | ||
Text { | ||
text: "2nd item", | ||
default_color: Color(BLACK), | ||
.. | ||
}, | ||
], | ||
.. | ||
}, | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
Spacer( | ||
InvisibleSpacer(5), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters