forked from cory/tildefriends
editor: Fix in-browser prettification of html files.
This commit is contained in:
parent
9758844da3
commit
8273277c91
@ -1782,10 +1782,11 @@ async function sourcePretty() {
|
||||
let prettier = (await import('/prettier/standalone.mjs')).default;
|
||||
let babel = (await import('/prettier/babel.mjs')).default;
|
||||
let estree = (await import('/prettier/estree.mjs')).default;
|
||||
let prettier_html = (await import('/prettier/html.mjs')).default;
|
||||
let source = gEditor.state.doc.toString();
|
||||
let formatted = await prettier.format(source, {
|
||||
parser: 'babel',
|
||||
plugins: [babel, estree],
|
||||
parser: gCurrentFile?.toLowerCase()?.endsWith('.html') ? 'html' : 'babel',
|
||||
plugins: [babel, estree, prettier_html],
|
||||
trailingComma: 'es5',
|
||||
useTabs: true,
|
||||
semi: true,
|
||||
|
Loading…
Reference in New Issue
Block a user