Fix JSON tables with non-string values

What does this MR do and why?

Fix JSON tables with non-string values.

Ensure strings are UTF-8 encoded when we pass them to GLFMMarkdown; it's not just the empty string we have to worry about, it turns out.

References

Fixes `json:table` with integer cell values raises `T... (#596559 - closed).

Screenshots or screen recordings

With this input:

```json:table
{"fields":[{"key":"a"}],
 "items":[{"a":42}],
 "markdown":true}
```
Before After
image image

How to set up and validate locally

  1. Try making a comment with the above Markdown in it. Observe it fails. (You also fail to preview it, or to paste it into the rich-text editor.)
  2. Check this branch out.
  3. Repeat. Observe it succeeds.
  4. Observe.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading