adamschwartz / log

Console.log with style.
https://adamschwartz.co/log
MIT License
3.01k stars 140 forks source link

Multiline 'code' blocks? #16

Closed jfrux closed 10 years ago

jfrux commented 11 years ago

Thinking the only difference is that in your regex we should allow for multiline?

It seems that log('this is a test') matches code for test but log('this is a function () { hello; })

adamschwartz commented 11 years ago

Thanks for submitting this issue.

If you want to use a multiline string in javascript, you totally can. However note that the output won't actually display those line breaks. For example:

log("`this is a function () {\
hello;\
}`")

However, if you want multiple lines displayed in the code block, you can use \n. For example:

log('this is multiline code: \n`a == b \n c == d`')