Stop manually piecing together HTML in TableOfContentsTagFilter

What does this MR do and why?

Stop manually piecing together HTML in TableOfContentsTagFilter.

Fixes Stop manually piecing together HTML in TableOfC... (#588674) by not manually writing out HTML in Ruby, which is a very naughty practice and to be eschewed and tutted at.

This would have prevented Wiki [[_TOC_]] links are double URL-encoded for... (#594982) from ever occurring. (Note that's not a live bug, just a past one, so no changelog entry for this MR.)

How to set up and validate locally

Check that [[_TOC_]] tags still work in Markdown fields where they're expected to work, like issue/MR descriptions (not notes), and wiki pages. Particularly, ensure they still work even with non-ASCII characters, like this example from Wiki [[_TOC_]] links are double URL-encoded for... (#594982):

[[_TOC_]]

## はじめに

Some content here.

## セットアップ方法

Some content here.

(I put lots of separate paragraphs of content between each header so I could tell the links actually worked!)

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