From 79358663ebf932ad1accabe046c600fd76e1119e Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Sun, 17 Aug 2025 18:43:57 +0800 Subject: [PATCH] fix: improve indentation and formatting for style element creation in plugin --- scripts/plugin/template/src/index.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/plugin/template/src/index.js b/scripts/plugin/template/src/index.js index d98d25eec..316e616fa 100644 --- a/scripts/plugin/template/src/index.js +++ b/scripts/plugin/template/src/index.js @@ -9,21 +9,21 @@ export default function {{export}}(option) { } if (typeof document !== 'undefined') { - const id = 'artplayer-plugin-{{name}}'; - let $style = document.getElementById(id) - if (!$style) { - $style = document.createElement('style') - $style.id = id - if (document.readyState === 'loading') { - document.addEventListener('DOMContentLoaded', () => { - document.head.appendChild($style) - }) - } - else { - (document.head || document.documentElement).appendChild($style) - } + const id = 'artplayer-plugin-{{name}}'; + let $style = document.getElementById(id) + if (!$style) { + $style = document.createElement('style') + $style.id = id + if (document.readyState === 'loading') { + document.addEventListener('DOMContentLoaded', () => { + document.head.appendChild($style) + }) } - $style.textContent = style + else { + (document.head || document.documentElement).appendChild($style) + } + } + $style.textContent = style } if (typeof window !== 'undefined') {