File tree Expand file tree Collapse file tree 3 files changed +40
-5
lines changed
lib/plugins/filter/before_post_render Expand file tree Collapse file tree 3 files changed +40
-5
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ function backtickCodeBlock(data) {
63
63
. replace ( / { / g, '{' )
64
64
. replace ( / } / g, '}' ) ;
65
65
66
- return `${ start } <escape>${ content } </escape>${ end ? '\n\n' : '' } ` ;
66
+ return `${ start } <escape>${ content } </escape>${ end } ` ;
67
67
} ) ;
68
68
}
69
69
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ exports.content = content;
29
29
exports . expected = [
30
30
'<h1 id="Title"><a href="#Title" class="headerlink" title="Title"></a>Title</h1>' ,
31
31
util . highlight ( code , { lang : 'python' } ) ,
32
- '\n\n <p>some content</p>\n' ,
32
+ '\n<p>some content</p>\n' ,
33
33
'<h2 id="Another-title"><a href="#Another-title" class="headerlink" title="Another title"></a>Another title</h2>' ,
34
34
'<blockquote>' ,
35
35
'<p>quote content</p>\n' ,
@@ -41,7 +41,7 @@ exports.expected = [
41
41
exports . expected_disable_nunjucks = [
42
42
'<h1 id="Title"><a href="#Title" class="headerlink" title="Title"></a>Title</h1>' ,
43
43
util . highlight ( code , { lang : 'python' } ) ,
44
- '\n\n <p>some content</p>\n' ,
44
+ '\n<p>some content</p>\n' ,
45
45
'<h2 id="Another-title"><a href="#Another-title" class="headerlink" title="Another title"></a>Another title</h2>' ,
46
46
'<p>{% blockquote %}<br>' ,
47
47
'quote content<br>' ,
Original file line number Diff line number Diff line change @@ -734,8 +734,7 @@ describe('Post', () => {
734
734
content
735
735
} ) . then ( data => {
736
736
data . content . trim ( ) . should . eql ( [
737
- '<blockquote>' + highlighted ,
738
- '</blockquote>'
737
+ '<blockquote>' + highlighted + '</blockquote>'
739
738
] . join ( '\n' ) ) ;
740
739
} ) ;
741
740
} ) ;
@@ -802,4 +801,40 @@ describe('Post', () => {
802
801
} ) ;
803
802
} ) ;
804
803
804
+ // test for Issue #3767
805
+ it ( 'render() - backtick cocde block (followed by a paragraph) in blockquote' , ( ) => {
806
+ const code = 'alert("Hello world")' ;
807
+ const highlighted = util . highlight ( code ) ;
808
+ const quotedContent = [
809
+ 'This is a code-block' ,
810
+ '' ,
811
+ '```' ,
812
+ code ,
813
+ '```' ,
814
+ '' ,
815
+ 'This is a following paragraph'
816
+ ] ;
817
+
818
+ const content = [
819
+ 'Hello' ,
820
+ '' ,
821
+ ...quotedContent . map ( s => '> ' + s )
822
+ ] . join ( '\n' ) ;
823
+
824
+ return post . render ( null , {
825
+ content,
826
+ engine : 'markdown'
827
+ } ) . then ( data => {
828
+ data . content . trim ( ) . should . eql ( [
829
+ '<p>Hello</p>' ,
830
+ '<blockquote>' ,
831
+ '<p>This is a code-block</p>' ,
832
+ highlighted ,
833
+ '' ,
834
+ '<p>This is a following paragraph</p>' ,
835
+ '</blockquote>'
836
+ ] . join ( '\n' ) ) ;
837
+ } ) ;
838
+ } ) ;
839
+
805
840
} ) ;
You can’t perform that action at this time.
0 commit comments