Refactor, simplify and unify helpers for rendering markup
Created by: jirutka
This PR is closely related to #9288. I’m sending it separately to avoid unnecessary delays with reviewing and merging #9288.
Created by: jirutka
This PR is closely related to #9288. I’m sending it separately to avoid unnecessary delays with reviewing and merging #9288.