Capture vertical material in vbox and vtop
This commit is contained in:
1 parent
5e9552d785
commit
7ad3c327ec
8 files changed
+99
-14
No files matched your search
@@ -479,6 +479,7 @@ struct Parser {
|
||||
inline_boxes: Vec<InlineBoxSpec>,
|
||||
minipage: Option<MinipageBuilder>,
|
||||
footnote_capture: Option<Vec<Run>>,
|
||||
vbox_stack: Vec<(Vec<Block>, Vec<Option<SourceLocation>>)>,
|
||||
footnote_counter: u32,
|
||||
page_decoration_capture: Option<(
|
||||
bool,
|
||||
@@ -538,6 +539,7 @@ impl Parser {
|
||||
inline_boxes: Vec::new(),
|
||||
minipage: None,
|
||||
footnote_capture: None,
|
||||
vbox_stack: Vec::new(),
|
||||
footnote_counter: 0,
|
||||
page_decoration_capture: None,
|
||||
float_placement: String::new(),
|
||||
@@ -887,6 +889,22 @@ impl Parser {
|
||||
self.framed_box = Some(Vec::new());
|
||||
}
|
||||
}
|
||||
expanded::FrontendEventKind::VBoxStart => {
|
||||
self.flush_paragraph();
|
||||
let blocks = std::mem::take(&mut self.document.blocks);
|
||||
let sources = std::mem::take(&mut self.document.block_sources);
|
||||
self.vbox_stack.push((blocks, sources));
|
||||
}
|
||||
expanded::FrontendEventKind::VBoxEnd => {
|
||||
self.flush_paragraph();
|
||||
let Some((blocks, sources)) = self.vbox_stack.pop() else {
|
||||
return;
|
||||
};
|
||||
let inner_blocks = std::mem::replace(&mut self.document.blocks, blocks);
|
||||
let inner_sources = std::mem::replace(&mut self.document.block_sources, sources);
|
||||
self.document.blocks.extend(inner_blocks);
|
||||
self.document.block_sources.extend(inner_sources);
|
||||
}
|
||||
expanded::FrontendEventKind::ParboxStart { width } => {
|
||||
self.flush_paragraph();
|
||||
self.box_frame = false;
|
||||
|
||||
Reference in new issue
Block a user