Links do not get rendered in a table using GitHub Action's summary feature

35 views Asked by At

If I call the following code in a GitHub action:

summary
  .addHeading("Links", 2)
  .addTable([
    [{ data: 'Site', header: true }, { data: 'Url', header: true }],
    ["Google", "[google.com](https://google.com)"]
  ]
).write();

I would expect it to make a table like:

Links

Site Url
Google google.com

Instead, the url field does not get rendered as a link, and, instead of being google.com, it is [google.com](https://google.com).

It ends up looking something like this:

Links

Site Url
Google [google.com](https://google.com)

Is there a way to render the links inside the table?

1

There are 1 answers

0
Javier Bullrich On

Found the answer in the comment by @jonrsharpe.

It's not treated as Markdown, it directly builds an HTML table. So provide an HTML link, not a Markdown one.

By converting my code into an html a tag, it renders properly:

summary
  .addHeading("Links", 2)
  .addTable([
    [{ data: 'Site', header: true }, { data: 'Url', header: true }],
    ["Google", '<a href="https://google.com">google.com</a>']
  ]
).write();