Skip to content

Use built-in multiline block quotes from parser

Brett Walker requested to merge bw-enable-comrak-blockquote into master

What does this MR do and why?

This removes the use of our own Banzai::Filter::BlockquoteFenceFilter and instead uses what is available in the parser. You can see the specs that gitlab-glfm-markdown is tested against here: https://gitlab.com/gitlab-org/ruby/gems/gitlab-glfm-markdown/blob/main/spec/fixtures/glfm-spec/multiline_blockquote.txt

I've actually kept Banzai::Filter::BlockquoteFenceFilter in the code / pipelines, and simply don't execute it if running with the Rust parser. This is so that later down the road, as more things get implemented in the new parser, we can run more meaningful benchmark comparisons against the old and new banzai pipelines. We will eventually strip them out.

Note that our old syntax requires a blank line before and after the blockquote. The new implementation no longer requires this, and in fact now works properly in all sorts of cases, such as embedded in lists.

This also fixes markdown: multi-line blockquote not rendering c... (#390290 - closed)

You'll also notice we've been able to remove the use of MARKDOWN_CODE_BLOCK_REGEX and MARKDOWN_HTML_BLOCK_REGEX, which is always a good thing.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #398216 (closed)

Edited by Brett Walker

Merge request reports