Address review feedback

This commit is contained in:
Gabriel Horner
2022-01-28 10:48:44 -05:00
parent 664b32e03a
commit 54420c9a5d
12 changed files with 2 additions and 99 deletions

View File

@@ -1,25 +1,17 @@
(ns frontend.diff
(:require [clojure.string :as string]
["diff" :as jsdiff]
["diff-match-patch" :as diff-match-patch]
[goog.object :as gobj]
[lambdaisland.glogi :as log]
[cljs-bean.core :as bean]
[frontend.util :as util]
[frontend.text :as text]))
;; TODO: replace with diff-match-patch
(defn diff
[s1 s2]
(-> ((gobj/get jsdiff "diffLines") s1 s2)
bean/->clj))
(defonce dmp (diff-match-patch.))
(defn diffs
[s1 s2]
(.diff_main dmp s1 s2 true))
(def inline-special-chars
#{\* \_ \/ \` \+ \^ \~ \$})