forked from typst/hayagriva
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix formatting of collapsed numeric citations (typst#176)
* Update preset styles * Add failing test for typst#154 * Fix formatting of collapsed numeric citations * Revert changes to archive * Refactor collapse_items * Replace collapse test with local version * Remove styles/numeric.csl * simplify test * slightly improve collapse code * remove redundant test import * wrap comment at 80 columns
- Loading branch information
1 parent
d5ea285
commit 05ed80e
Showing
2 changed files
with
188 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
>>===== MODE =====>> | ||
citation | ||
<<===== MODE =====<< | ||
|
||
Simplified from collapse_CitationNumberRangesInsert.txt | ||
|
||
|
||
>>===== RESULT =====>> | ||
[1–8] | ||
[1–3;5] | ||
[4,6–8] | ||
[2,3,6] | ||
<<===== RESULT =====<< | ||
|
||
>>===== CITATION-ITEMS =====>> | ||
[ | ||
[ | ||
{ | ||
"id": "ITEM-1" | ||
}, | ||
{ | ||
"id": "ITEM-2" | ||
}, | ||
{ | ||
"id": "ITEM-3" | ||
}, | ||
{ | ||
"id": "ITEM-4" | ||
}, | ||
{ | ||
"id": "ITEM-5" | ||
}, | ||
{ | ||
"id": "ITEM-6" | ||
}, | ||
{ | ||
"id": "ITEM-7" | ||
}, | ||
{ | ||
"id": "ITEM-8" | ||
} | ||
], | ||
[ | ||
{ | ||
"id": "ITEM-1" | ||
}, | ||
{ | ||
"id": "ITEM-2" | ||
}, | ||
{ | ||
"id": "ITEM-3" | ||
}, | ||
{ | ||
"id": "ITEM-5" | ||
} | ||
], | ||
[ | ||
{ | ||
"id": "ITEM-4" | ||
}, | ||
{ | ||
"id": "ITEM-6" | ||
}, | ||
{ | ||
"id": "ITEM-7" | ||
}, | ||
{ | ||
"id": "ITEM-8" | ||
} | ||
], | ||
[ | ||
{ | ||
"id": "ITEM-2" | ||
}, | ||
{ | ||
"id": "ITEM-3" | ||
}, | ||
{ | ||
"id": "ITEM-6" | ||
} | ||
] | ||
] | ||
<<===== CITATION-ITEMS =====<< | ||
|
||
|
||
>>===== CSL =====>> | ||
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0"> | ||
<info> | ||
<id /> | ||
<title /> | ||
<updated>2009-08-10T04:49:00+09:00</updated> | ||
</info> | ||
<citation collapse="citation-number" after-collapse-delimiter=";"> | ||
<sort> | ||
<key variable="author" /> | ||
<key variable="issued" /> | ||
</sort> | ||
<layout prefix="[" suffix="]" delimiter=","> | ||
<text variable="citation-number" /> | ||
</layout> | ||
</citation> | ||
</style> | ||
<<===== CSL =====<< | ||
|
||
|
||
>>===== INPUT =====>> | ||
[ | ||
{ | ||
"id": "ITEM-1", | ||
"title": "Paper 1", | ||
"type": "book" | ||
}, | ||
{ | ||
"id": "ITEM-2", | ||
"title": "Paper 2", | ||
"type": "book" | ||
}, | ||
{ | ||
"id": "ITEM-3", | ||
"title": "Paper 3", | ||
"type": "book" | ||
}, | ||
{ | ||
"id": "ITEM-4", | ||
"title": "Paper 4", | ||
"type": "book" | ||
}, | ||
{ | ||
"id": "ITEM-5", | ||
"title": "Paper 5", | ||
"type": "book" | ||
}, | ||
{ | ||
"id": "ITEM-6", | ||
"title": "Paper 6", | ||
"type": "book" | ||
}, | ||
{ | ||
"id": "ITEM-7", | ||
"title": "Paper 7", | ||
"type": "book" | ||
}, | ||
{ | ||
"id": "ITEM-8", | ||
"title": "Paper 8", | ||
"type": "book" | ||
} | ||
] | ||
<<===== INPUT =====<< | ||
|
||
|
||
>>===== VERSION =====>> | ||
1.0 | ||
<<===== VERSION =====<< |