@vue/compiler-sfc 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-sfc.js +4 -1
- package/package.json +1 -1
package/dist/compiler-sfc.js
CHANGED
|
@@ -646,6 +646,7 @@ const DEFAULT_FILENAME = 'anonymous.vue';
|
|
|
646
646
|
const splitRE$1 = /\r?\n/g;
|
|
647
647
|
const replaceRE = /./g;
|
|
648
648
|
const isSpecialTag = makeMap('script,style,template', true);
|
|
649
|
+
const isNeedIndentLang = makeMap('pug,jade');
|
|
649
650
|
/**
|
|
650
651
|
* Parse a single-file component (*.vue) file into an SFC Descriptor Object.
|
|
651
652
|
*/
|
|
@@ -740,7 +741,9 @@ function parseComponent(source, options = {}) {
|
|
|
740
741
|
if (depth === 1 && currentBlock) {
|
|
741
742
|
currentBlock.end = start;
|
|
742
743
|
let text = source.slice(currentBlock.start, currentBlock.end);
|
|
743
|
-
if (options.deindent
|
|
744
|
+
if (options.deindent ||
|
|
745
|
+
// certain langs like pug are indent sensitive, preserve old behavior
|
|
746
|
+
(currentBlock.lang && isNeedIndentLang(currentBlock.lang))) {
|
|
744
747
|
text = deIndent(text);
|
|
745
748
|
}
|
|
746
749
|
// pad content so that linters and pre-processors can output correct
|