Skip to content

Commit

Permalink
fix rules
Browse files Browse the repository at this point in the history
  • Loading branch information
fishjar committed May 30, 2024
1 parent 10112f4 commit f637731
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const FIXER_BN_DIV = "bnToDiv";
const GLOBAL_KEY = "*";

const DEFAULT_SELECTOR = `:is(li, p, h1, h2, h3, h4, h5, h6, dd, blockquote, .kiss-p)`;
const DEFAULT_KEEP_SELECTOR = `code, img, svg, pre`;
const DEFAULT_KEEP_SELECTOR = `code, img, svg, pre, a:has(code)`;
const DEFAULT_RULE = {
pattern: "", // 匹配网址
selector: "", // 选择器
Expand Down Expand Up @@ -104,10 +104,6 @@ const RULES_MAP = {
selector: `main ${DEFAULT_SELECTOR}`,
keepSelector: DEFAULT_KEEP_SELECTOR,
},
"doc.rust-lang.org": {
selector: `.content ${DEFAULT_SELECTOR}`,
keepSelector: DEFAULT_KEEP_SELECTOR,
},
"www.indiehackers.com": {
selector: `h1, h3, .content ${DEFAULT_SELECTOR}, .feed-item__title-link`,
},
Expand Down Expand Up @@ -248,15 +244,19 @@ const RULES_MAP = {
},
"go.dev/tour": {
selector: `#left-side ${DEFAULT_SELECTOR}`,
keepSelector: `code, img, svg >>> code`,
keepSelector: DEFAULT_KEEP_SELECTOR,
},
"pkg.go.dev": {
selector: `.Documentation-content ${DEFAULT_SELECTOR}`,
keepSelector: `${DEFAULT_KEEP_SELECTOR}, a, span`,
},
"docs.rs": {
"docs.rs, doc.rust-lang.org/std/, doc.rust-lang.org/nightly/, doc.rust-lang.org/stable/": {
selector: `.docblock ${DEFAULT_SELECTOR}, .docblock-short`,
keepSelector: `code >>> code`,
keepSelector: DEFAULT_KEEP_SELECTOR,
},
"doc.rust-lang.org/book/, doc.rust-lang.org/cargo/, doc.rust-lang.org/rust-by-example/, doc.rust-lang.org/embedded-book/": {
selector: `.content ${DEFAULT_SELECTOR}`,
keepSelector: DEFAULT_KEEP_SELECTOR,
},
"randomnerdtutorials.com": {
selector: `article ${DEFAULT_SELECTOR}`,
Expand Down

0 comments on commit f637731

Please sign in to comment.