diff --git a/src/config/rules.js b/src/config/rules.js index b164a4d..d975f2e 100644 --- a/src/config/rules.js +++ b/src/config/rules.js @@ -172,11 +172,9 @@ export const DEFAULT_OW_RULE = { const RULES_MAP = { "www.google.com/search": { rootsSelector: `#rcnt`, - textStyle: OPT_STYLE_BLOCKQUOTE, }, "en.wikipedia.org": { ignoreSelector: `.button, code, footer, form, mark, pre, .mwe-math-element, .mw-editsection`, - textStyle: OPT_STYLE_BLOCKQUOTE, }, "news.ycombinator.com": { selector: `p, .titleline, .commtext`, @@ -184,18 +182,15 @@ const RULES_MAP = { keepSelector: `code, img, svg, pre, .sitebit`, ignoreSelector: `button, code, footer, form, header, mark, nav, pre, .reply`, autoScan: `false`, - textStyle: OPT_STYLE_BLOCKQUOTE, }, "twitter.com, https://x.com": { selector: `[data-testid='tweetText']`, keepSelector: `img, svg, span:has(a), div:has(a)`, autoScan: `false`, - textStyle: OPT_STYLE_DASHBOX, }, "www.youtube.com": { rootsSelector: `ytd-page-manager`, ignoreSelector: `aside, button, footer, form, header, pre, mark, nav, #player, #container, .caption-window, .ytp-settings-menu`, - textStyle: OPT_STYLE_DASHBOX, }, }; diff --git a/src/libs/rules.js b/src/libs/rules.js index bda14ef..ddbfad4 100644 --- a/src/libs/rules.js +++ b/src/libs/rules.js @@ -178,7 +178,10 @@ export const checkRules = (rules) => { injectCss: type(injectCss) === "string" ? injectCss : "", bgColor: type(bgColor) === "string" ? bgColor : "", textDiyStyle: type(textDiyStyle) === "string" ? textDiyStyle : "", - apiSlug: apiSlug?.trim() || DEFAULT_API_TYPE, + apiSlug: + type(apiSlug) === "string" && apiSlug.trim() !== "" + ? apiSlug.trim() + : GLOBAL_KEY, fromLang: matchValue([GLOBAL_KEY, ...fromLangs], fromLang), toLang: matchValue([GLOBAL_KEY, ...toLangs], toLang), textStyle: matchValue([GLOBAL_KEY, ...OPT_STYLE_ALL], textStyle),