gitlab-org--gitlab-foss/lib/banzai
Yorick Peterse d470f3d195
Support for rendering/redacting multiple documents
This commit changes the way certain documents are rendered (currently
only Notes) and how documents are redacted. Previously both rendering
and redacting would run on a per document basis. The result of this was
that for every document we'd have to run countless queries just to
figure out if we could display a set of links or not.

This commit changes things around so that redacting Markdown documents
is no longer tied into the html-pipeline Gem. This in turn allows it to
redact multiple documents in a single pass, thus reducing the number of
queries needed.

In turn rendering issue/merge request notes has been adjusted to take
advantage of this new setup. Instead of rendering Markdown somewhere
deep down in a view the Markdown is rendered and redacted in the
controller (taking the current user and all that into account). This has
been done in such a way that the "markdown()" helper method can still be
used on its own.

This particular commit also paves the way for caching rendered HTML on
object level. Right now there's an accessor method Note#note_html which
is used for setting/getting the rendered HTML. Once we cache HTML on row
level we can simply change this field to be a column and call a "save"
whenever needed and we're pretty much done.
2016-06-24 11:46:39 +02:00
..
filter Support for rendering/redacting multiple documents 2016-06-24 11:46:39 +02:00
pipeline Support for rendering/redacting multiple documents 2016-06-24 11:46:39 +02:00
reference_parser Eager load project relations in IssueParser 2016-06-15 15:30:34 +02:00
cross_project_reference.rb Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
filter.rb Remove redundant `require`s from Banzai files 2016-03-24 13:23:47 -04:00
filter_array.rb Add FilterArray class to Banzai 2016-03-01 15:54:35 -05:00
note_renderer.rb Support for rendering/redacting multiple documents 2016-06-24 11:46:39 +02:00
object_renderer.rb Support for rendering/redacting multiple documents 2016-06-24 11:46:39 +02:00
pipeline.rb Prevent circular reference error in Banzai 2016-01-14 11:30:28 +01:00
querying.rb Optimize CSS expressions produced by Nokogiri 2015-12-31 15:46:47 +01:00
redactor.rb Support for rendering/redacting multiple documents 2016-06-24 11:46:39 +02:00
reference_extractor.rb Split Markdown rendering & reference gathering 2016-05-26 17:14:00 +02:00
reference_parser.rb Split Markdown rendering & reference gathering 2016-05-26 17:14:00 +02:00
renderer.rb Move pre_process into render_result 2016-06-21 17:39:01 +02:00