See #1333 and #1437. fix vue nested templates formatted incorrectly

This commit is contained in:
Glavin Wiechert 2017-04-15 02:47:17 -03:00
parent 40a07b29e9
commit a1b19ba8aa
1 changed files with 1 additions and 1 deletions

View File

@ -12,7 +12,7 @@ module.exports = class VueBeautifier extends Beautifier
beautify: (text, language, options) ->
return new @Promise((resolve, reject) ->
regexp = /(^<(template|script|style)[^>]*>)((\s|\S)*?)^<\/\2>/gim
regexp = /(^<(template|script|style)[^>]*>)((\s|\S)*)^<\/\2>/gim
resolve(text.replace(regexp, (match, begin, type, text) ->
lang = /lang\s*=\s*['"](\w+)["']/.exec(begin)?[1]