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

Creating newlines in preformatted tags such as <pre> and <textarea>? #4

Closed
rehno-lindeque opened this issue Sep 21, 2010 · 2 comments
Closed

Comments

@rehno-lindeque
Copy link

Is there a way of inserting newlines into tags such as <pre> and <textarea>?
For example, the following does not have the desired result of 2 separate lines as you would have in regular html:

%textarea
  This is line number 1.
  This is line number 2.

There might be other related issues with preformatted text. I seem to remember that you can insert strings into <pre> you wouldn't be able to insert into normal html...?

@snoyberg
Copy link
Member

Hamlet doesn't actually pay attention to what tags you're writing. To get the desired result, you'd need:

%textarea
  This is line number 1.
  \
  This is line number 2.

See the backslash escaping section of http://docs.yesodweb.com/book/hamlet/

@rehno-lindeque
Copy link
Author

Oh right, for some reason I didn't realize that \ could create newlines in the html. Thanks for that

This issue was closed.
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