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

<textarea> has line-breaks removed? #147

Closed
aquynh opened this Issue Jul 31, 2014 · 9 comments

Comments

Projects
None yet
3 participants
@aquynh

aquynh commented Jul 31, 2014

I am using Jekyll 2.2.0. In my markdown file, I have a simple HTML code textarea like this:

<textarea>
hello

world
</textarea>

You can see that there are few line-breaks between hello and world. The problem is that jekyll build then removes the line-breaks between them.

How can I tell Kramdown not to remove line-breaks like this?

Thanks.

@gettalong gettalong self-assigned this Jul 31, 2014

@gettalong gettalong added the bug label Jul 31, 2014

@gettalong

This comment has been minimized.

Owner

gettalong commented Jul 31, 2014

Will be fixed with the next release of kramdown.

@aquynh

This comment has been minimized.

aquynh commented Jul 31, 2014

On Jul 31, 2014 6:07 PM, "Thomas Leitner" notifications@github.com wrote:

Will be fixed with the next release of kramdown.

Any workaround that you can recommend, if I cannot wait for the next
version?

Thanks

@gettalong

This comment has been minimized.

Owner

gettalong commented Jul 31, 2014

You need to edit the source code. Remove the word "textarea" from the line https://github.com/gettalong/kramdown/blob/master/lib/kramdown/parser/html.rb#L55

@aquynh

This comment has been minimized.

aquynh commented Jul 31, 2014

On Thu, Jul 31, 2014 at 11:29 PM, Thomas Leitner notifications@github.com
wrote:

You need to edit the source code. Remove the word "textarea" from the line
https://github.com/gettalong/kramdown/blob/master/lib/kramdown/parser/html.rb#L55

i tried, but this doesnt seem to help: the problem is still there.

here is how i did:

  • i directly modified this file on my OSX machine:

/Library/Ruby/Gems/2.0.0/gems/kramdown-1.4.0/lib/kramdown/parser/html.rb

  • then i run "jekyll build" again.

the line-breaks inside are still eaten.

did i do that wrongly?

thanks.

@gettalong

This comment has been minimized.

Owner

gettalong commented Jul 31, 2014

That should do the trick. Please try the standalone kramdown binary to check if it works correctly. If it does, it is a problem with Jekyll.

@aquynh

This comment has been minimized.

aquynh commented Jul 31, 2014

On Fri, Aug 1, 2014 at 2:24 AM, Thomas Leitner notifications@github.com
wrote:

That should do the trick. Please try the standalone kramdown binary to
check if it works correctly. If it does, it is a problem with Jekyll.

how to try the standalone kramdown binary to confirm it actually fixes this
issue?

thanks.

@larryhynes

This comment has been minimized.

larryhynes commented Aug 1, 2014

See kramdown -help for some guidance.

To test a testfile.markdown the command would be something like kramdown -i kramdown -o html testfile.markdown. This will output the html to stdout, you could redirect it to a file with kramdown -i kramdown -o html testfile.markdown > testfile.html.

@aquynh

This comment has been minimized.

aquynh commented Aug 1, 2014

thanks! i can confirm that this fixes the issue with Kramdown, but Jekyll
still removed line-breaks inside <textarea>

any suggestion on where to look in Jekyll source to fix this problem?

thanks.

@gettalong

This comment has been minimized.

Owner

gettalong commented Aug 1, 2014

I haven't used Jekyll so I'm the wrong person. Please have a look at the Jekyll website to find the right place for this question.

@gettalong gettalong closed this in 4461286 Aug 1, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment