Decouple graph-parser util from app util usage

For tiny util heavily used fns like safe-re-find and uuid-string?,
decouple graph-parser from so much of the app
This commit is contained in:
Gabriel Horner
2022-05-13 16:17:43 -04:00
parent b9bbd0c605
commit 5b0d5fb8b5
27 changed files with 88 additions and 83 deletions

View File

@@ -1,6 +1,6 @@
(ns frontend.security
(:require [clojure.walk :as walk]
[logseq.graph-parser.util :as gp-util]))
[frontend.util :as util]))
;; To prevent from cross-site scripting vulnerability, we should add security checks for both hiccup and raw html.
;; Hiccup: [:a {:href "javascript:alert('hei')"} "click me"]
@@ -12,7 +12,7 @@
(= :a (first f))
(:href (second f))
(:href (second f))
(gp-util/safe-re-find #"(?i)javascript" (:href (second f)))))
(util/safe-re-find #"(?i)javascript" (:href (second f)))))
(defn remove-javascript-links-in-href
[hiccup]