|
|
@@ -262,6 +262,10 @@
|
|
|
(when @src
|
|
|
(resizable-image config title @src metadata full_text true))))
|
|
|
|
|
|
+(defn ar-url->http-url
|
|
|
+ [href]
|
|
|
+ (string/replace href #"^ar://" (str (state/get-arweave-gateway) "/")))
|
|
|
+
|
|
|
;; TODO: safe encoding asciis
|
|
|
;; TODO: image link to another link
|
|
|
(defn image-link [config url href label metadata full_text]
|
|
|
@@ -280,6 +284,9 @@
|
|
|
(util/starts-with? href "http")
|
|
|
href
|
|
|
|
|
|
+ (util/starts-with? href "ar")
|
|
|
+ (ar-url->http-url href)
|
|
|
+
|
|
|
config/publishing?
|
|
|
(subs href 1)
|
|
|
|
|
|
@@ -991,6 +998,16 @@
|
|
|
(state/set-state! :pdf/current current)))}
|
|
|
(get-label-text label)]
|
|
|
|
|
|
+ (= protocol "ar")
|
|
|
+ (->elem
|
|
|
+ :a.external-link
|
|
|
+ (cond->
|
|
|
+ {:href (ar-url->http-url href)
|
|
|
+ :target "_blank"}
|
|
|
+ title
|
|
|
+ (assoc :title title))
|
|
|
+ (map-inline config label))
|
|
|
+
|
|
|
:else
|
|
|
(->elem
|
|
|
:a.external-link
|