rum 2020-05-23

Question , how can I type multi-line content in a div like: [:div "this is \n on two lines"]

Clojure strings are already multiline

I mean, they don't render the newline on the page

[:div "this is \n on two lines"]
or
[:div "this is
 on two lines"]
both just render a single line string. I'd like it to render with <br /> ?

I think

[:div [:span "this is"] [:br] [:span "on two lines"]] 
Should work. You need a br tag to do a new line in HTML. I'm sure you can write a helper function to split strings into spans/br based on new line symbol to make life easier for you

Ya, that's what I ended up doing, thanks!

Its okay though. I think for proper web HTML anyways, I should probably split my paragraphs with p tags, and not really rely on br anyways. And let the rest reflow automatically