Commit b762fc4b authored by Douwe Maan's avatar Douwe Maan

Allow trailing whitespace on blockquote fence lines

parent 99fdbe4c
---
title: Allow trailing whitespace on blockquote fence lines
merge_request:
author:
type: fixed
...@@ -10,7 +10,7 @@ module Banzai ...@@ -10,7 +10,7 @@ module Banzai
^``` ^```
.+? .+?
\n```$ \n```\ *$
) )
| |
(?<html> (?<html>
...@@ -19,9 +19,9 @@ module Banzai ...@@ -19,9 +19,9 @@ module Banzai
# Anything, including `>>>` blocks which are ignored by this filter # Anything, including `>>>` blocks which are ignored by this filter
# </tag> # </tag>
^<[^>]+?>\n ^<[^>]+?>\ *\n
.+? .+?
\n<\/[^>]+?>$ \n<\/[^>]+?>\ *$
) )
| |
(?: (?:
...@@ -30,14 +30,14 @@ module Banzai ...@@ -30,14 +30,14 @@ module Banzai
# Anything, including code and HTML blocks # Anything, including code and HTML blocks
# >>> # >>>
^>>>\n ^>>>\ *\n
(?<quote> (?<quote>
(?: (?:
# Any character that doesn't introduce a code or HTML block # Any character that doesn't introduce a code or HTML block
(?! (?!
^``` ^```
| |
^<[^>]+?>\n ^<[^>]+?>\ *\n
) )
. .
| |
...@@ -48,7 +48,7 @@ module Banzai ...@@ -48,7 +48,7 @@ module Banzai
\g<html> \g<html>
)+? )+?
) )
\n>>>$ \n>>>\ *$
) )
}mx.freeze }mx.freeze
......
...@@ -11,4 +11,8 @@ describe Banzai::Filter::BlockquoteFenceFilter do ...@@ -11,4 +11,8 @@ describe Banzai::Filter::BlockquoteFenceFilter do
expect(output).to eq(expected) expect(output).to eq(expected)
end end
it 'allows trailing whitespace on blockquote fence lines' do
expect(filter(">>> \ntest\n>>> ")).to eq("> test")
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment