Skip to content

Commit

Permalink
fix empty fraction when setting per: "/" but not using per
Browse files Browse the repository at this point in the history
  • Loading branch information
scrouthtv authored and ChHecker committed Oct 7, 2023
1 parent c581d41 commit d2ab4c3
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -270,14 +270,23 @@
if normal-list.at(0).at("cond") {
formatted += space
}
formatted += " ("

if per-list.len() > 0 {
formatted += " ("
}

for (i, chunk) in normal-list.enumerate() {
let (string: n, cond: space-set) = chunk
if i != 0 and space-set {
formatted += space
}
formatted += n
}

if per-list.len() == 0 {
return formatted
}

formatted += ")/("
for (i, chunk) in per-list.enumerate() {
let (string: p, cond: space-set) = chunk
Expand Down Expand Up @@ -416,14 +425,23 @@
if normal-list.at(0).at("cond") {
formatted += space
}

if per-list.len() > 0 {
formatted += " ("
}

for (i, chunk) in normal-list.enumerate() {
let (string: n, cond: space-set) = chunk
if i != 0 and space-set {
formatted += space
}
formatted += n
}

if per-list.len() == 0 {
return formatted
}

formatted += ")/("
for (i, chunk) in per-list.enumerate() {
let (string: p, cond: space-set) = chunk
Expand Down

0 comments on commit d2ab4c3

Please sign in to comment.