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

markup gets spaces added in front on every edit #19

Closed
tpo opened this issue Apr 12, 2011 · 2 comments
Closed

markup gets spaces added in front on every edit #19

tpo opened this issue Apr 12, 2011 · 2 comments

Comments

@tpo
Copy link

tpo commented Apr 12, 2011

When the wiki content contains newlines, then those get rendered as such by Erubis (RoR 3's ERB engine), and then get "correctly" indented in the produced HTML code. The following line is responsible for this:

irwi/app/views/base_wiki_pages/edit.html.erb:16
<p><%=wt 'Content:' %><br /><%= f.text_area :content %></p>

The produced HTML looks like this:

______<p>Content:<br /><textarea cols="40" id="page_content" name="page[content]" rows="20">First Line
________Second Line</textarea>

(the leading spaces above have been replaced by underscores). The problem is, that the spaces in front of "Second Line" will appear inside the textarea in the browser. And when the user submits the content as it is, those spaces will get added to the respectiv database wiki_page row.

I've googled around for two hours or so, and there seem to be other people having the same problem with ERB and f.textarea, however no solution for ERB/Erubis seems to be known.

@tpo
Copy link
Author

tpo commented Apr 12, 2011

This problem is fixed by tpo@bf60ccf

@tpo
Copy link
Author

tpo commented Apr 18, 2011

Closing, fix has been merged

@tpo tpo closed this as completed Apr 18, 2011
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

1 participant