feat: gate a run of blocks to chosen output formats
This commit is contained in:
parent
bb7a5111a1
commit
603f29b0f0
9 changed files with 437 additions and 22 deletions
|
|
@ -77,6 +77,9 @@ fn block_markup(block: &Block, settings: &PageSettings, out: &mut String) {
|
|||
Block::Rule => out.push_str("<p>---</p>\n"),
|
||||
// Alignment is a fixed-width concern; a handset lays out its own screen.
|
||||
Block::Aligned { block, .. } => block_markup(block, settings, out),
|
||||
// Gates are filtered out before rendering; keeping the content is the
|
||||
// harmless reading if one ever arrives here.
|
||||
Block::Gated { block, .. } => block_markup(block, settings, out),
|
||||
// Pagination here is the deck's own job, driven by the byte budget.
|
||||
Block::CardBreak { .. } => {}
|
||||
// Raw HTML is not WML and would not parse on a handset.
|
||||
|
|
|
|||
|
|
@ -112,6 +112,9 @@ fn self_block(block: &Block, out: &mut String) {
|
|||
// Alignment reaches only the fixed-width text formats. Pagination is a
|
||||
// WML concern; a browser scrolls one document.
|
||||
Block::Aligned { block, .. } => self_block(block, out),
|
||||
// Gates are filtered out before rendering; keeping the content is the
|
||||
// harmless reading if one ever arrives here.
|
||||
Block::Gated { block, .. } => self_block(block, out),
|
||||
Block::CardBreak { .. } => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue