diff options
author | Sean McGivern <sean@gitlab.com> | 2019-04-05 12:24:36 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2019-04-05 12:24:36 +0300 |
commit | 9bee979872bbdfb9930cc31ff7caed698acb3b58 (patch) | |
tree | 06cf410d97acf6afa9e05e980b802fdaa3bdb4dd /lib | |
parent | 5b273d355f47baa27b365e22b96a07187c78e1a7 (diff) | |
parent | 949bcb1f8d9695171d0dc88461f6a16800ac57c9 (diff) |
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.rb | 4 |
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 |