Add the ability to disable math rendering limits
What does this MR do and why?
There are various limits when rendering math equations - they can be time and resource intensive, and too many can cause huge delays in rendering a page.
While these limits are necessary on the Saas offering, those who run their own instance and use math extensively can be hampered by these limits.
- issues/MRs/wiki/repos:
RENDER_NODES_LIMIT
on the backend limits the number of nodes rendered in a markdown block to50
- issues/MRs/wiki/repos:
MAX_MACRO_EXPANSIONS
on the frontend limits the number of macro expansions to1000
- issues/MRs/wiki/repos:
MAX_USER_SPECIFIED_EMS
on the frontend limits user-specified sizes to20ems
- issues/MRs:
MAX_MATH_CHARS
on the frontend limits the number of characters in a math block to1000
- issues/MRs:
MAX_RENDER_TIME_MS
on the frontend limits the amount of time it takes to render to2000ms
How to set up and validate locally
-
open a Rails console and check that
ApplicationSetting.first.math_rendering_limits_enabled?
returnstrue
-
go to an issue and add the following in a comment box
$`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$ + $`a^2+b^2=c^2`$
-
use Preview and verify that only a portion of the formulas are displayed as rendered math
-
go back to the Rails console and do a
ApplicationSetting.update(math_rendering_limits_enabled: false)
-
back on the comment box, you should be able to Preview again and all the formulas will be displayed as rendered math
-
Note: it may require you to reload the page once or twice to ensure the update application settings are propagated
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #214530 (closed)