Support formatting LWC syntax in markdown (#19291)
This commit is contained in:
1 parent
527180393c
commit
91f155f7f5
7 files changed
+132
-1
No files matched your search
@@ -0,0 +1,97 @@
|
||||
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
|
||||
|
||||
exports[`lwc.md - {"embeddedLanguageFormatting":"off"} format 1`] = `
|
||||
====================================options=====================================
|
||||
embeddedLanguageFormatting: "off"
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
\`\`\`html
|
||||
<test-this attr={should-be-quoted}>
|
||||
Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`lwc
|
||||
<test-this attr={should-NOT-quoted}>
|
||||
Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
=====================================output=====================================
|
||||
\`\`\`html
|
||||
<test-this attr={should-be-quoted}>
|
||||
Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`lwc
|
||||
<test-this attr={should-NOT-quoted}>
|
||||
Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`lwc.md format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
\`\`\`html
|
||||
<test-this attr={should-be-quoted}>
|
||||
Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`lwc
|
||||
<test-this attr={should-NOT-quoted}>
|
||||
Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
=====================================output=====================================
|
||||
\`\`\`html
|
||||
<test-this attr="{should-be-quoted}"> Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
\`\`\`lwc
|
||||
<test-this attr={should-NOT-quoted}> Awesome</test-this>
|
||||
\`\`\`
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`lwc-invalid.md - {"embeddedLanguageFormatting":"off"} format 1`] = `
|
||||
====================================options=====================================
|
||||
embeddedLanguageFormatting: "off"
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
\`\`\`lwc
|
||||
<test-this>
|
||||
Awesome</test-this></this-is-invalid>
|
||||
\`\`\`
|
||||
|
||||
=====================================output=====================================
|
||||
\`\`\`lwc
|
||||
<test-this>
|
||||
Awesome</test-this></this-is-invalid>
|
||||
\`\`\`
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
exports[`lwc-invalid.md format 1`] = `
|
||||
====================================options=====================================
|
||||
parsers: ["markdown"]
|
||||
printWidth: 80 (default) |
|
||||
=====================================input======================================
|
||||
\`\`\`lwc
|
||||
<test-this>
|
||||
Awesome</test-this></this-is-invalid>
|
||||
\`\`\`
|
||||
|
||||
=====================================output=====================================
|
||||
\`\`\`lwc
|
||||
<test-this>
|
||||
Awesome</test-this></this-is-invalid>
|
||||
\`\`\`
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
@@ -0,0 +1,2 @@
|
||||
runFormatTest(import.meta, ["markdown"]);
|
||||
runFormatTest(import.meta, ["markdown"], { embeddedLanguageFormatting: "off" });
|
||||
@@ -0,0 +1,4 @@
|
||||
```lwc
|
||||
<test-this>
|
||||
Awesome</test-this></this-is-invalid>
|
||||
```
|
||||
@@ -0,0 +1,9 @@
|
||||
```html
|
||||
<test-this attr={should-be-quoted}>
|
||||
Awesome</test-this>
|
||||
```
|
||||
|
||||
```lwc
|
||||
<test-this attr={should-NOT-quoted}>
|
||||
Awesome</test-this>
|
||||
```
|
||||
Reference in new issue
Block a user