File tree 2 files changed +30
-0
lines changed 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,16 @@ exports.expected = [
37
37
'<blockquote><p>quote content</p>\n' ,
38
38
'<footer><strong>Hello World</strong></footer></blockquote>'
39
39
] . join ( '' ) ;
40
+
41
+ exports . expected_disable_nunjucks = [
42
+ '<h1 id="Title"><a href="#Title" class="headerlink" title="Title"></a>Title</h1>' ,
43
+ util . highlight ( code , { lang : 'python' } ) ,
44
+ '\n\n<p>some content</p>\n' ,
45
+ '<h2 id="Another-title"><a href="#Another-title" class="headerlink" title="Another title"></a>Another title</h2>' ,
46
+ '<p>{% blockquote %}<br>' ,
47
+ 'quote content<br>' ,
48
+ '{% endblockquote %}</p>\n' ,
49
+ '<p>{% quote Hello World %}<br>' ,
50
+ 'quote content<br>' ,
51
+ '{% endquote %}</p>'
52
+ ] . join ( '' ) ;
Original file line number Diff line number Diff line change @@ -686,4 +686,21 @@ describe('Post', () => {
686
686
callback ( ) ;
687
687
} ) ;
688
688
} ) ;
689
+
690
+ // test for PR [#3573](https://github.com/hexojs/hexo/pull/3573)
691
+ it ( 'render() - disableNunjucks' , ( ) => {
692
+ const renderer = hexo . render . renderer . get ( 'markdown' ) ;
693
+ renderer . disableNunjucks = true ;
694
+
695
+ return post . render ( null , {
696
+ content : fixture . content ,
697
+ engine : 'markdown'
698
+ } ) . then ( data => {
699
+ data . content . trim ( ) . should . eql ( fixture . expected_disable_nunjucks ) ;
700
+ } ) . then ( data => {
701
+ renderer . disableNunjucks = false ;
702
+ } ) ;
703
+
704
+ } ) ;
705
+
689
706
} ) ;
You can’t perform that action at this time.
0 commit comments