Skip to content

Rendering bug fixes: markdown in titles and link spacing

Sarah German requested to merge render-link-extra-space into main

What does this MR do and why?

Two minor markdown rendering fixes:

  1. Fixes a bug where links have an extra space after them. This is only really noticeable when they're at the end of a sentence, like on this page: https://gitlab-org.gitlab.io/technical-writing-group/gitlab-docs-hugo/administration/logs/log_parsing/

    This is kind of a funny one: it comes up because we provide a Go template to manipulate links at build time, and our text editors automatically put newlines at the end of files. Further explanation here: https://stackoverflow.com/questions/69031332/hugo-shortcode-adding-extra-space-at-end-of-link-text

    To fix this, we can just add the {{- "" -}} at the end of the shortcode, which instructs Hugo to trim any trailing whitespace.

  2. Allow for markdown in titles. Sometimes we use backticks to style words in titles.

Screenshots, screen recordings, or links to review app

Before After
image image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Configure a local GitLab Docs environment: https://gitlab.com/gitlab-org/technical-writing-group/gitlab-docs-hugo/-/blob/main/doc/setup.md.
  2. Visit this page to see both bugs: http://localhost:1313/administration/logs/log_parsing/

Merge request acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports