Ticket #36 (new defect)
Opened 6 months ago
.hard_breaks = true nukes opening and closing <p>'s for some reason
| Reported by: | rogerdpack | Owned by: | why |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | ext | Version: | 3.0.4 |
| Keywords: | Cc: |
Description
Sorry the description is somewhat long.
gem 'RedCloth?', '=3.0.4'
=> true
description = "An 18-credit, program specifically designed to enhance your professional marketability in one of today's fastest growing fields. Employment opportunities as Human Resources Generalists, Recruiters, Equal Employment Opportunity Representatives, Employer Relations' Representatives, Interviewers, Job Analysts and Training and Development Specialists.\n\nh3. Advantages for Central Penn Human Resources Certification:\n\n* Complete this program in conjunction with a Business Administration degree or as a Continuing Education certificate.\n* Get the skills needed for your next promotion today.\n* Enjoy a high placement rate for this growing career field.\n* Convenient course scheduling (evening, weekend and online).\n* Accelerated 11-week terms.\n* Experience small class sizes and personalized instruction.\n* Learn from professors who have first hand, real-world experience.\n* What kind of work will I do?\n\n"
=> ...
require 'redcloth'
=> true
test = RedCloth?.new(description, [ :hard_breaks ])
=> ...
test.hard_breaks = true
=> true
test.to_html
=> "An 18-credit, program specifically designed to enhance your professional marketability in one of today’s fastest growing fields. Employment opportunities as Human Resources Generalists, Recruiters, Equal Employment Opportunity Representatives, Employer Relations’ Representatives, Interviewers, Job Analysts and Training and Development Specialists.<br />\n\t<h3>Advantages for Central Penn Human Resources Certification:<br />\n\t<ul>\n\t<li>Complete this program in conjunction with a Business Administration degree or as a Continuing Education certificate.</li>\n\t\t<li>Get the skills needed for your next promotion today.</li>\n\t\t<li>Enjoy a high placement rate for this growing career field.</li>\n\t\t<li>Convenient course scheduling (evening, weekend and online).</li>\n\t\t<li>Accelerated 11-week terms.</li>\n\t\t<li>Experience small class sizes and personalized instruction.</li>\n\t\t<li>Learn from professors who have first hand, real-world experience.</li>\n\t\t<li>What kind of work will I do?</li>\n\t</ul></h3>"
It is lacking opening and closing <p>'s for some reason. Works with 3.0.3 (and is the reason why 3.0.3 is the one usually used by rails developers, I'd imagine).
Note this described ad nauseum in http://wiki.rubyonrails.org/rails/pages/RedCloth
and the code I used found in /opt/local/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/text_helper.rb
Thanks!