diff options
author | Brett Walker <bwalker@gitlab.com> | 2019-04-03 08:42:23 -0500 |
---|---|---|
committer | Brett Walker <bwalker@gitlab.com> | 2019-04-04 18:59:31 -0500 |
commit | 949bcb1f8d9695171d0dc88461f6a16800ac57c9 (patch) | |
tree | 2716c2263861178b7ddd366f336700d40a73c35a /lib/banzai | |
parent | 3ccb4d954f4c51f4f3cc77ebd53f21425e0d4d09 (diff) | |
download | gitlab-ce-949bcb1f8d9695171d0dc88461f6a16800ac57c9.tar.gz |
Fenced blockquotes to not change source line pos58717-checkbox-cannot-be-checked-if-a-blockquote-is-above
Replaces blockquote fences with \n,
keeping the line numbering intact.
Diffstat (limited to 'lib/banzai')
-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 |