This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-09
Channels
- # announcements (26)
- # babashka (4)
- # beginners (17)
- # calva (21)
- # cider (13)
- # clerk (17)
- # clj-commons (23)
- # clj-kondo (3)
- # cljdoc (47)
- # cljsrn (10)
- # clojure (123)
- # clojure-belgium (2)
- # clojure-dev (25)
- # clojure-europe (34)
- # clojure-gamedev (2)
- # clojure-italy (1)
- # clojure-nl (3)
- # clojure-norway (4)
- # clojure-uk (4)
- # clojurescript (86)
- # cursive (12)
- # datahike (2)
- # datomic (2)
- # emacs (4)
- # fulcro (6)
- # funcool (15)
- # instaparse (1)
- # integrant (11)
- # jobs (1)
- # joyride (9)
- # kaocha (3)
- # membrane (8)
- # off-topic (1)
- # pathom (4)
- # practicalli (2)
- # quil (1)
- # rdf (1)
- # reagent (9)
- # remote-jobs (1)
- # shadow-cljs (27)
- # spacemacs (4)
- # specter (1)
- # sql (11)
- # tools-deps (55)
- # vim (1)
For "Snippets" saved in the Sources panel of Chromium-based Dev Tools, running the snippet prints the (synchronous) evaluation of the final expression of the snippet onto the console. Cool.
If this output is a string it easily distinguished from console.log
s because it prints colorized and wrapped in a pair of single-quotes. (In dark mode its a nice cyan/teal. In light mode, a less helpful slightly-darkened red that is hard to distinguish from error logs.) Cool.
Seems this uses a non-standard string printer that fails to parse newline escape-seqs into newline chars. A string with \n
prints that as \n
. Same with \r\n
. Same problem with this sorta-sketchy play at hand-typing a literal-newline.
// Leading semi here because I don't use trailing semis.
// Breaks the backtick from code on previous line which
// could otherwise be incorrectly interpreted.
;`
`
// => '\n'
Not cool.
Anyone have any ideas on how to coerce this special string printer for Dev Tools Snippets into printing an actual newline char?