Skip to content

ClojureScript: fipp interacts badly with console.log as default print strategyΒ #84

Description

@eauc

So I apologize if this is a silly question, but I'm trying to use fipp in clojurescript and it prints a single character per line, with options like width having no effect.

Funily enough, if I capture the output in a string and print it, everything is fine πŸ˜…

(ns test-fipp.core
  (:require [fipp.edn]))

(defn main
  []
  (fipp.edn/pprint [1 2 3] {:width 100})
  (cljs.core/*print-fn*
   (with-out-str
     (fipp.edn/pprint [1 2 3] {:width 100}))))

outputs

[
1
 
2
 
3
]

[1 2 3]

I tried this in node and my browser, using shadow-cljs to build the project

I've setup a basic projet to show this behaviour
https://github.com/eauc/test-fipp

any idea what I'm doing wrong ? thanks in advance πŸ™

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions