fix(glossy): use codepoints (not bytes!) in article code

Fixes [#18](https://github.com/swaits/typst-collection/issues/18)
This commit is contained in:
swaits committed 2024-12-20 12:37:21 -07:00
1 parent c37c6750c6
commit 842166c211
5 files changed
+46 -3

No files matched your search

+1 -1
View File
@@ -605,7 +605,7 @@
// 1. create array of tuples with (lower [if ignore-case], entry)
.map(e => { if ignore-case { (lower(e.short), e) } else { (e.short, e) } })
// 2. sort the tuples (by first element then second)
.sorted(key: t => t.first())
.sorted() // NOTE: sorted() is NOT language-aware
// 3. strip away the tuple's first element, leaving an array of entries
.map(t => t.last())
+2 -2
View File
@@ -203,7 +203,7 @@
if is_acronym {
// Use acronym rules
let first_char = upper_word.slice(0,1)
let first_char = upper_word.codepoints().slice(0,1).first()
if acronym_vowels.contains(first_char) {
"an"
} else {
@@ -211,7 +211,7 @@
}
} else {
// Non-acronym rules
let first_char = lower_word.slice(0,1)
let first_char = lower_word.codepoints().slice(0,1).first()
// Special cases for words matching a set of known 'silent h' prefixes
let silent_h_words = (