Fix smartquotes in outline (#1047)

Fixes #1041.
This commit is contained in:
chris-02 2023-05-01 13:29:40 +02:00 committed by GitHub
parent 4c4bee9845
commit 407d8a3ab2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -568,6 +568,11 @@ fn collect<'a>(
let region = TextElem::region_in(styles);
let quotes = Quotes::from_lang(lang, region);
let peeked = iter.peek().and_then(|child| {
let child = if let Some((child, _)) = child.to_styled() {
child
} else {
child
};
if let Some(elem) = child.to::<TextElem>() {
elem.text().chars().next()
} else if child.is::<SmartQuoteElem>() {

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -0,0 +1,4 @@
#set page(width: 15em)
#outline()
= "This" "is" "a" "test"