@@ -32,7 +32,7 @@ var renderHighlight = function(str, lang) {
32
32
* @param {[type] } html [description]
33
33
* @return {[type] } [description]
34
34
*/
35
- var renderVueTemplate = function ( html ) {
35
+ var renderVueTemplate = function ( html , wrapper ) {
36
36
var $ = cheerio . load ( html , {
37
37
decodeEntities : false ,
38
38
lowerCaseAttributeNames : false ,
@@ -49,9 +49,9 @@ var renderVueTemplate = function(html) {
49
49
$ ( "script" ) . remove ( ) ;
50
50
51
51
result =
52
- " <template><section>" +
52
+ ` <template><${ wrapper } >` +
53
53
$ . html ( ) +
54
- "</section ></template>\n" +
54
+ `</ ${ wrapper } ></template>\n` +
55
55
output . style +
56
56
"\n" +
57
57
output . script ;
@@ -81,7 +81,8 @@ module.exports = function(source) {
81
81
{
82
82
preset : "default" ,
83
83
html : true ,
84
- highlight : renderHighlight
84
+ highlight : renderHighlight ,
85
+ wrapper : 'section'
85
86
} ,
86
87
opts
87
88
) ;
@@ -154,7 +155,7 @@ module.exports = function(source) {
154
155
source = source . replace ( / @ / g, "__at__" ) ;
155
156
156
157
var content = parser . render ( source ) . replace ( / _ _ a t _ _ / g, "@" ) ;
157
- var result = renderVueTemplate ( content ) ;
158
+ var result = renderVueTemplate ( content , opts . wrapper ) ;
158
159
159
160
if ( opts . raw ) {
160
161
return result ;
0 commit comments