File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 7171 ; ; https://html.spec.whatwg.org/multipage/syntax.html#cdata-rcdata-restrictions
7272 (str/replace s " </script>" " </nextjournal.clerk.view/escape-closing-script-tag>" ))
7373
74- (defn ->html [{:as state :keys [conn-ws? current-path html exclude-js?]}]
74+ (defn ->html [{:as state :keys [conn-ws? current-path html exclude-js? render-router ]}]
7575 (hiccup/html5
7676 [:head
7777 [:meta {:charset " UTF-8" }]
9393 [:div#clerk html]
9494 (when-not exclude-js?
9595 [:script {:type " module" } " let viewer = nextjournal.clerk.sci_env
96- let state = " (-> state v/->edn escape-closing-script-tag pr-str) " .replaceAll('nextjournal.clerk.view/escape-closing-script-tag', 'script')
96+ let state = " (-> ( if ( = render-router :fetch-edn ) ( dissoc state :path->doc ) state) v/->edn escape-closing-script-tag pr-str) " .replaceAll('nextjournal.clerk.view/escape-closing-script-tag', 'script')
9797viewer.init(viewer.read_string(state))\n "
9898 (when conn-ws?
9999 " viewer.connect(document.location.origin.replace(/^http/, 'ws') + '/_ws')\n " )])]))
Original file line number Diff line number Diff line change 7373 :report-fn identity})
7474 (slurp (fs/file temp-dir " index.html" )))]
7575 (is (str/includes? html-out " <meta content=\" 🔫 My OG Title\" property=\" og:title\" >" ))
76- (is (str/includes? html-out " <meta content=\" https://clerk.vision/my-open-graph-url\" property=\" og:url\" >" )))))
76+ (is (str/includes? html-out " <meta content=\" https://clerk.vision/my-open-graph-url\" property=\" og:url\" >" ))
77+ (is (not (str/includes? html-out " :path->doc" ))))))
7778
7879 (utils/when-not-bb
7980 (testing " image is saved to _data dir"
You can’t perform that action at this time.
0 commit comments