Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,095 changes: 1,095 additions & 0 deletions _input_alignment_test.v

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions _markdown_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -1109,19 +1109,27 @@ fn test_markdown_heading_anchor_set() {
// Superscript/subscript tests

fn test_markdown_superscript() {
rt := markdown_to_rich_text('E=mc^2^', MarkdownStyle{})
style := MarkdownStyle{}
rt := markdown_to_rich_text('E=mc^2^', style)
sup_runs := rt.runs.filter(it.text == '2')
assert sup_runs.len >= 1
// OpenType 'sups' feature handles sizing
assert sup_runs[0].style.size < style.text.size
assert sup_runs[0].style.rise > 0
assert sup_runs[0].style.features != unsafe { nil }
assert sup_runs[0].style.features.opentype_features.len == 1
assert sup_runs[0].style.features.opentype_features[0].tag == 'sups'
}

fn test_markdown_subscript() {
rt := markdown_to_rich_text('H~2~O', MarkdownStyle{})
style := MarkdownStyle{}
rt := markdown_to_rich_text('H~2~O', style)
sub_runs := rt.runs.filter(it.text == '2')
assert sub_runs.len >= 1
// OpenType 'subs' feature handles sizing
assert sub_runs[0].style.size < style.text.size
assert sub_runs[0].style.rise < 0
assert sub_runs[0].style.features != unsafe { nil }
assert sub_runs[0].style.features.opentype_features.len == 1
assert sub_runs[0].style.features.opentype_features[0].tag == 'subs'
}

fn test_markdown_subscript_vs_strikethrough() {
Expand Down
2 changes: 2 additions & 0 deletions _styles_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ fn test_text_style_to_vglyph_cfg_mapping() {
ts := TextStyle{
family: 'Roboto'
size: 16.0
rise: 3.5
underline: true
strikethrough: true
}
Expand All @@ -14,6 +15,7 @@ fn test_text_style_to_vglyph_cfg_mapping() {

assert cfg.style.font_name == 'Roboto'
assert cfg.style.size == 16.0
assert cfg.style.rise == 3.5
assert cfg.style.underline == true
assert cfg.style.strikethrough == true
}
Expand Down
Loading
Loading