Fix citation grouping bug with spaces

This commit is contained in:
Laurenz 2023-10-31 12:19:30 +01:00
parent 7bb4f6df44
commit c177a63c9b
6 changed files with 32 additions and 3 deletions

View File

@ -755,6 +755,7 @@ impl<'a> CiteGroupBuilder<'a> {
}
if let Some(citation) = content.to::<CiteElem>() {
self.staged.retain(|(elem, _)| !elem.is::<SpaceElem>());
self.items.push(citation.clone(), styles);
return true;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,7 +1,16 @@
#set page(width: 300pt)
@mcintosh_anxiety, @psychology25
@netwok, @issue201, @arrgh, @quark, @distress,
@glacier-melt, @issue201, @tolkien54, @sharing, @restful
@mcintosh_anxiety
@psychology25
@netwok
@issue201
@arrgh
@quark
@distress,
@glacier-melt
@issue201
@tolkien54
@sharing
@restful
#bibliography("/files/works.bib")

View File

@ -0,0 +1,19 @@
// Test citation grouping.
---
A#[@netwok@arrgh]B \
A@netwok@arrgh B \
A@netwok @arrgh B \
A@netwok @arrgh. B \
A @netwok#[@arrgh]B \
A @netwok@arrgh, B \
A @netwok @arrgh, B \
A @netwok @arrgh. B \
A#[@netwok @arrgh @quark]B. \
A @netwok @arrgh @quark B. \
A @netwok @arrgh @quark, B.
#set text(0pt)
#bibliography("/files/works.bib")