Fix bug with basically empty paragraph
This commit is contained in:
parent
f7875032b7
commit
e8dd842c66
@ -824,6 +824,19 @@ fn line<'a>(
|
||||
mandatory: bool,
|
||||
hyphen: bool,
|
||||
) -> Line<'a> {
|
||||
if range.is_empty() {
|
||||
return Line {
|
||||
bidi: &p.bidi,
|
||||
range,
|
||||
first: None,
|
||||
items: &[],
|
||||
last: None,
|
||||
width: Length::zero(),
|
||||
mandatory,
|
||||
dash: false,
|
||||
};
|
||||
}
|
||||
|
||||
// Find the last item.
|
||||
let (last_idx, last_offset) =
|
||||
p.find_idx_and_offset(range.end.saturating_sub(1)).unwrap();
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 29 KiB |
@ -25,3 +25,9 @@ D
|
||||
#set page(width: 200pt)
|
||||
#set par(justify: true)
|
||||
中文维基百科使用汉字书写,汉字是汉族或华人的共同文字,是中国大陆、新加坡、马来西亚、台湾、香港、澳门的唯一官方文字或官方文字之一。25.9%,而美国和荷兰则分別占13.7%及8.2%。近年來,中国大陆地区的维基百科编辑者正在迅速增加;
|
||||
|
||||
---
|
||||
// Test that there are no hick-ups with justification enabled and
|
||||
// basically empty paragraph.
|
||||
#set par(justify: true)
|
||||
{""}
|
||||
|
Loading…
Reference in New Issue
Block a user