mirror of
https://github.com/logseq/logseq.git
synced 2026-05-25 21:24:21 +00:00
chore(typos): exclude color-data files and rename unparseable→unparsable
CI's spell-check (crate-ci/typos) flagged two patterns introduced by this PR: - `daa` inside hex color values (`e6daa6` beige, `daa520` goldenrod) in colors/named.cljs and colors/css.cljs. Pure tokenizer artifact; the hex codes are W3C canonical and can't be renamed. - `unparseable` in 3 docstrings + 1 comment of colors.cljs. Both spellings are valid English; typos prefers `unparsable`. Fix surgically rather than growing the global word allowlist: add the two color-data files to `extend-exclude` (they're pure lookup tables with no prose to spell-check anyway), and rename `unparseable` in colors.cljs to `unparsable`. No code semantics changed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
(defn parse-css-color->hex
|
||||
"Parse a computed CSS color value (hex / hsl(...) / rgb(...)) into a hex
|
||||
string. Returns nil for blank or unparseable input."
|
||||
string. Returns nil for blank or unparsable input."
|
||||
[s]
|
||||
(when-let [v (some-> s string/trim not-empty)]
|
||||
(cond
|
||||
@@ -60,7 +60,7 @@
|
||||
;; callbacks fire at the microtask boundary, before React commits the
|
||||
;; render scheduled by the same set-state! that triggered the flip, so
|
||||
;; subscribers always see fresh values on the next paint. `contains?`
|
||||
;; check lets us cache nil too (var unset / unparseable).
|
||||
;; check lets us cache nil too (var unset / unparsable).
|
||||
(defonce ^:private *bg-var-cache (atom {}))
|
||||
|
||||
(defn- invalidate-bg-var-cache! []
|
||||
@@ -77,7 +77,7 @@
|
||||
(defn read-bg-var
|
||||
"Read a CSS background variable (e.g. \"--ls-primary-background-color\") and
|
||||
return its hex value. Tries body first (where Logseq sets theme vars), falls
|
||||
back to documentElement. Returns nil if unset/unparseable.
|
||||
back to documentElement. Returns nil if unset/unparsable.
|
||||
|
||||
Cached per theme; cache invalidates on `documentElement` attribute changes
|
||||
(data-theme / class), so theme flips are observed without an explicit
|
||||
@@ -582,7 +582,7 @@
|
||||
:match :hex | :css | :exact | :prefix
|
||||
:name optional-string (omitted for :hex)
|
||||
:tentative? bool (only true for :prefix)}
|
||||
or nil. Whitespace-only / blacklisted / unparseable -> nil.
|
||||
or nil. Whitespace-only / blacklisted / unparsable -> nil.
|
||||
Public boundary."
|
||||
[s]
|
||||
(when (and (string? s) (<= (count s) 64))
|
||||
|
||||
@@ -25,4 +25,8 @@ extend-exclude = ["resources/*",
|
||||
"deps/db-sync/test/logseq/db_sync/fixtures/*.edn",
|
||||
"clj-e2e/resources/*",
|
||||
"deps/common/src/logseq/common/plural.cljs",
|
||||
"packages/ui/src/amplify/lang.ts"]
|
||||
"packages/ui/src/amplify/lang.ts",
|
||||
# Pure W3C named-color → hex tables; hex digits trip the typos
|
||||
# tokenizer ("daa" inside "e6daa6"/"daa520" etc.). No prose.
|
||||
"src/main/frontend/colors/named.cljs",
|
||||
"src/main/frontend/colors/css.cljs"]
|
||||
|
||||
Reference in New Issue
Block a user