Playground: autofold for Markdown and other languages (#8331)

This commit is contained in:
Georgii Dolzhykov authored and GitHub committed 2020-05-18 12:15:00 +03:00
1 parent c5ece64c21
commit caeb367c16
1 file changed
+11 -1
+11 -1
View File
@@ -56,6 +56,9 @@ const astAutoFold = {
estree: /^\s*"(loc|start|end)":/,
postcss: /^\s*"(source|input|raws|file)":/,
html: /^\s*"(sourceSpan|valueSpan|nameSpan|startSourceSpan|endSourceSpan|tagDefinition)":/,
mdast: /^\s*"position":/,
yaml: /^\s*"position":/,
glimmer: /^\s*"loc":/,
};
export function getAstAutoFold(parser) {
@@ -76,7 +79,14 @@ export function getAstAutoFold(parser) {
case "html":
case "angular":
case "vue":
case "lws":
case "lwc":
return astAutoFold.html;
case "markdown":
case "mdx":
return astAutoFold.mdast;
case "yaml":
return astAutoFold.yaml;
case "glimmer":
return astAutoFold.glimmer;
}
}