Accept table position options and row separator gaps
This commit is contained in:
1 parent
18c0288db0
commit
8bd725e9ff
5 files changed
+76
-5
No files matched your search
+18
-1
@@ -1068,7 +1068,15 @@ fn strip_page_geometry(source: &str) -> (String, PageGeometry) {
|
||||
}
|
||||
}
|
||||
if let Some((environment, rest)) = table_environment {
|
||||
if let Some((template, _)) = braced(rest.trim_start()) {
|
||||
let rest = rest.trim_start();
|
||||
let rest = match rest
|
||||
.strip_prefix('[')
|
||||
.and_then(|after| after.split_once(']'))
|
||||
{
|
||||
Some((_, tail)) => tail.trim_start(),
|
||||
None => rest,
|
||||
};
|
||||
if let Some((template, _)) = braced(rest) {
|
||||
if !body.ends_with('\n') {
|
||||
body.push('\n');
|
||||
}
|
||||
@@ -7336,6 +7344,15 @@ See \ref{fig:a} and \ref{tab:b}.";
|
||||
assert_eq!(blocks[1].space_before, 5, "12pt itemsep");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tabular_optional_position_is_ignored() {
|
||||
let (body, geometry) = geometry_and_body("\\begin{tabular}[t]{ll}\nA & B\n\\end{tabular}");
|
||||
assert_eq!(geometry.tabular.len(), 1);
|
||||
assert_eq!(geometry.tabular[0].0, "ll");
|
||||
assert!(body.contains("texrratable"), "missing placeholder: {body}");
|
||||
assert!(!body.contains("tabular"), "environment leaked: {body}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn longtable_captures_its_body() {
|
||||
let (body, geometry) =
|
||||
|
||||
Reference in new issue
Block a user