Skip to content

Render footnotes in the Content Editor

Himanshu Kapoor requested to merge 338271-footnotes into master

What does this MR do and why?

This MR implements partial support for rendering footnotes in the Content Editor. What do I mean by partial?

  • When defining footnotes in GFM, you can use any symbol as the footnote ID:
This reference tag is a mix of letters and numbers. [^footnote-42]

[^footnote-42]: This is another footnote.

Ideally, we want the Content Editor to preserve footnote-42 as the footnote id. We can’t achieve this goal because the Markdown renderer in the backend doesn’t include all the footnotes’ metadata.

The purpose of delivering partial rendering support of footnotes in the Content Editor is to avoid completely breaking the footnotes when loading an existing document. We will improve this feature once #343365 (closed) is resolved.

Can I edit footnotes in the Content Editor?

This MR is not about editing support, but only displaying footnotes. However, you can still apply certain edit operations:

  • You can delete footnotes references, but you can’t insert them.
  • You can edit the text of a footnote definition, but you can’t add a new one or remove an existing one.

Screenshots or screen recordings

Screen_Shot_2021-10-21_at_9.48.44_AM

How to set up and validate locally

  • Edit or create a new Wiki page

  • Insert the following Markdown snippet in the Classic Markdown Editor

    A footnote reference tag looks like this: [^1]
    
    This reference tag is a mix of letters and numbers. [^2]
    
    [^1]: This is the text inside a footnote.
    
    [^2]: This is another footnote.
  • Click the button "Use the new editor"

  • You should see the footnotes that look exactly as the screenshot above

MR acceptance checklist

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

Related to #338271 (closed)

Edited by Enrique Alcántara

Merge request reports

Loading