summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2019-04-05 09:24:36 +0000
committerSean McGivern <sean@gitlab.com>2019-04-05 09:24:36 +0000
commit9bee979872bbdfb9930cc31ff7caed698acb3b58 (patch)
tree06cf410d97acf6afa9e05e980b802fdaa3bdb4dd /lib
parent5b273d355f47baa27b365e22b96a07187c78e1a7 (diff)
parent949bcb1f8d9695171d0dc88461f6a16800ac57c9 (diff)
downloadgitlab-ce-9bee979872bbdfb9930cc31ff7caed698acb3b58.tar.gz
Merge branch '58717-checkbox-cannot-be-checked-if-a-blockquote-is-above' into 'master'
Checkbox cannot be checked if preceded by a blockquote Closes #58717 See merge request gitlab-org/gitlab-ce!26937
Diffstat (limited to 'lib')
-rw-r--r--lib/banzai/filter/blockquote_fence_filter.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/banzai/filter/blockquote_fence_filter.rb b/lib/banzai/filter/blockquote_fence_filter.rb
index ad367cc5efe..8f5ad9981e5 100644
--- a/lib/banzai/filter/blockquote_fence_filter.rb
+++ b/lib/banzai/filter/blockquote_fence_filter.rb
@@ -42,7 +42,9 @@ module Banzai
def call
@text.gsub(REGEX) do
if $~[:quote]
- $~[:quote].gsub(/^/, "> ").gsub(/^> $/, ">")
+ # keep the same number of source lines/positions by replacing the
+ # fence lines with newlines
+ "\n" + $~[:quote].gsub(/^/, "> ").gsub(/^> $/, ">") + "\n"
else
$~[0]
end