From 2a4094fe06ad65c1b944cd8a72940ca9b539dae8 Mon Sep 17 00:00:00 2001 From: PgBiel <9021226+PgBiel@users.noreply.github.com> Date: Tue, 8 Oct 2024 23:58:03 -0300 Subject: [PATCH] fix inf string in 0.12.0 --- oxifmt.typ | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/oxifmt.typ b/oxifmt.typ index 639efc6..b712148 100644 --- a/oxifmt.typ +++ b/oxifmt.typ @@ -189,9 +189,16 @@ } #let _strfmt_stringify(obj) = { - if type(obj) in (_int-type, _float-type) { - // Fix negative sign not being a hyphen - // for consistency with our rich formatting output + if type(obj) == _float-type { + if _float-is-infinite(obj) { + // Fix 0.12.0 inf string inconsistency + if obj < 0 { "-" } else { "" } + "inf" + } else { + // Fix negative sign not being a hyphen + // for consistency with our rich formatting output + str(obj).replace("\u{2212}", "-") + } + } else if type(obj) == _int-type { str(obj).replace("\u{2212}", "-") } else if type(obj) in (_label-type, _str-type) { str(obj)