Merge branch 'dm-blockquote-trailing-whitespace' into 'master'

Allow trailing whitespace on blockquote fence lines

See merge request gitlab-org/gitlab-ce!19960
This commit is contained in:
Sean McGivern 2018-06-18 13:02:23 +00:00
commit 8451c5ff60
3 changed files with 15 additions and 6 deletions

View file

@ -0,0 +1,5 @@
---
title: Allow trailing whitespace on blockquote fence lines
merge_request:
author:
type: fixed

View file

@ -10,7 +10,7 @@ module Banzai
^```
.+?
\n```$
\n```\ *$
)
|
(?<html>
@ -19,9 +19,9 @@ module Banzai
# Anything, including `>>>` blocks which are ignored by this filter
# </tag>
^<[^>]+?>\n
^<[^>]+?>\ *\n
.+?
\n<\/[^>]+?>$
\n<\/[^>]+?>\ *$
)
|
(?:
@ -30,14 +30,14 @@ module Banzai
# Anything, including code and HTML blocks
# >>>
^>>>\n
^>>>\ *\n
(?<quote>
(?:
# Any character that doesn't introduce a code or HTML block
(?!
^```
|
^<[^>]+?>\n
^<[^>]+?>\ *\n
)
.
|
@ -48,7 +48,7 @@ module Banzai
\g<html>
)+?
)
\n>>>$
\n>>>\ *$
)
}mx.freeze

View file

@ -11,4 +11,8 @@ describe Banzai::Filter::BlockquoteFenceFilter do
expect(output).to eq(expected)
end
it 'allows trailing whitespace on blockquote fence lines' do
expect(filter(">>> \ntest\n>>> ")).to eq("> test")
end
end