Open
Description
_format_fields
seems clunky. The Javascript implementation in ratlog/ratlog.js seems a lot clearer
const fieldString = Object.entries(fields || {})
.map(([k, v]) => {
const key = formatField(k)
const value = formatField(v)
return ` | ${key}${value && ': ' + value}`
}).join('')
I also don't like the hacky newline escaping in escape
. However,
newline = "\n"
print(repr("\\" + newline))
# '\\\n'
It's possible to string.replace("\n", "\\n")
, but this just adds a special case for newlines. I don't know if this is better?
Metadata
Metadata
Assignees
Labels
No labels