Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline 'code' blocks? #16

Closed
jfrux opened this issue Jun 11, 2013 · 1 comment
Closed

Multiline 'code' blocks? #16

jfrux opened this issue Jun 11, 2013 · 1 comment

Comments

@jfrux
Copy link

jfrux commented Jun 11, 2013

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
Copy link
Owner

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`')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants