str() discards format() formatting
Kaedenn opened this issue ยท 2 comments
It would appear that str()
discards formatting generated via the format()
function.
The following displays text
, but without formatting:
/script run print(str('%s', format('rb test')))
I suggest having str()
preserve formatting when given a formatted string as an argument.
str()
is a wrapper for a good'ol printf function which is tuned for string composing, not just for %s but other formatters as well , format()
combines consecutive formatted strings. While it would be convenient if str
would preserve formatting, understanding what each of them is designed for makes sense that str()
only operates on simple strings.
What you would want to use is format strings with str and then pass them to format to create the final formatted output.
tl;dr; valid request, but won't fix due to extra complexity.