Skip to content

Commit

Permalink
fix: extra comma if one or more location fields are emtpy
Browse files Browse the repository at this point in the history
  • Loading branch information
mangkoran committed Jan 28, 2024
1 parent 57427d8 commit 6004a82
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions cv.typ
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,18 @@
// address
#let addresstext(info, uservars) = {
if uservars.showAddress {
block(
width: 100%, [#info.personal.location.city, #info.personal.location.region, #info.personal.location.country #info.personal.location.postalCode],
)
let address_line = ()
let location = info.personal.at("location")

for key in ("city", "region", "country") {
let value = location.at(key, default: none)
if value != none and value != "" {
address_line.push([#location.at(key, default: none)])
}
}

[#address_line.join(", ") #location.postalCode]

v(-0.5em)
}
}
Expand Down

0 comments on commit 6004a82

Please sign in to comment.