Render snippet title in backend using issuable title pipeline

What does this MR do and why?

First half of a fix for Render non-block (Markdown and/or HTML) markup ... (#577274). Note that, contrary to that work item, issue/MR/work item titles don't support full markup: just backtick code spans. This change brings consistency with this to snippets.

Note well, however, that this is only the backend change, which:

  1. Changes the render of the already-existing title_html to use the new pipeline; and,
  2. Exposes title_html via GraphQL.

Because (2) is new (we currently have but don't use title_html), we can't do the frontend change in the same MR.

That work follows (must be merged in a following milestone), at which point this becomes user-visible.

How to set up and validate locally

No user-facing changes yet, but you can confirm it's doing the right thing on the backend:

  1. Check out this branch.

  2. Go make a snippet with a title containing an inline code span, e.g.:
    image

  3. Confirm the title_html render in gdk rails console:

    [1] pry(main)> Snippet.find(44).title_html
      Snippet Load (0.3ms)  SELECT "snippets".* FROM "snippets" WHERE "snippets"."id" = 44 LIMIT 1 /*application:console,db_config_database:gitlabhq_development,db_config_name:main,console_hostname:aconnor--20250904-77Q07,console_username:kivikakk,line:(pry):2:in `__pry__'*/
    => "yummy <code>snippy</code> wahoo"

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.

Edited by Asherah Connor

Merge request reports

Loading