Skip to content

Support rendering markdown (GLFM) in JSON

What does this MR do and why?

This MR adds support for rendering GLFM markdown within JSON tables and is based off @ealcantara's excellent PoC suggestion.

  • the attribute "markdown": true must be added to the JSON. Otherwise the table is processed without any markdown
  • item data can contain markdown, as well as the caption
  • markdown in header fields is not supported

Related to Process Markdown and/or HTML data in JSON table (#375177 - closed)

MR acceptance checklist

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

Screenshots or screen recordings

Before (with no markdown) With GLFM markdown
Screenshot_2025-01-30_at_12.33.03_PM Screenshot_2025-01-30_at_12.33.33_PM

How to set up and validate locally

  1. Create a new Issue (for any project) using the following as the description and save:
    ```json:table
    {
      "fields": [
        {
          "key": "starts_at",
          "label": "Date",
          "sortable": true
        },
        {
          "key": "url",
          "label": "URL"
        }
      ],
      "items": [
        {
          "starts_at": "_2024-10-07_",
          "url": "#1+"
        },
        {
          "starts_at": "_2024-10-10_",
          "url": "https://example.com/page2.html"
        }
      ],
      "filter": true,
      "markdown": true,
      "caption": "**Now** we're cooking with fire. See #1+"
    }
  2. The references should expand, the dates italicized, the caption with some bolding and clickable link.
  3. If you remove the "markdown": true line, then the table is rendered as it was originally.
Edited by Brett Walker

Merge request reports

Loading