Empty markdown was correctly cached as empty html but then treated as out of date
What does this MR do?
Empty markdown generates empty rendered HTML which was always treated as uncached. This caused a pointless redundant UPDATE on every view of an issue such as sytses/test-2#1
Are there points in the code the reviewer needs to double check?
This code will still not handle things correctly if the markdown is non-empty and the rendered html is empty e.g.:
Banzai::Renderer.cacheless_render('[//]: # (This is also a comment.)', {project: nil})
=> ""
Perhaps we should just rip out all the tests for .present?
and treat empty strings as valid markdown/html? Perhaps they should be all be testing .nil?
?
Why was this MR needed?
Screenshots (if relevant)
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together -
Internationalization required/considered
What are the relevant issue numbers?
Edited by Gregory Stark