Search code examples
gitlabmarkdownkatex

GitLab stops rendering in-text LaTeX for markdown files after 50 occurrences


I have been using GitLab's LaTeX rendering feature in Markdown, and enjoy it tremendously. That being said, I have found that there is an upper limit to the number of in-text latex references.

After exactly 50 occurrences on one page, rendering will stop, with formatting changing from this (desired behavior)

... where <ASSUME CORRECT LATEX HERE> is maximized ...

to this

... where $\Delta \rho^\prime$ is maximized ...

(incorrect behavior). This is reproducible, with a minimal example uploaded to my gitlab here.

I have searched for any relevant information and have been unable to find any information on this limit, though I have found this gitlab issue which seems to be related, but does not solve the problem.

Does anyone know if there is a way to disable/bypass this limit, or else submit a ticket to the GitLab developers?

Thanks either way!


Solution

  • This could be related to issue 333514

    Current limitations on Math rendering is 1000 total characters per page OR 2000ms of runtime, whichever happens first, helps in preventing a DoS attack on all pages where we can render GFM.

    This is non-ideal for pages like Wikis where

    • There is no user-generated content.
    • The math diagrams can quickly rack up 2000ms of runtime or 1000 chars.

    A possible workaround can be found in j7168908jx/gitlab merge_requests 1

    https://gitlab.com/j7168908jx/gitlab/uploads/d888dec18b9c468e1c475b71f9b6fa26/image.png