Forum: Redcloth Selective RedCoth Failure

02e20ca787ba0a92ebed761964d50c8e?d=identicon&s=25 Dan Lamet (dlamet)
on 2011-05-08 20:27
I have a couple of apps in which I've used RedCloth for a number of
years.  I'm in the process of upgrading those apps to Rails 3 & RedCloth
4.2.7.  I'm getting a condition where certain tags are converted and
others ignored.  Take the following snippet as an example:

    h4. **Section Title**

    Some body text

That now converts to

h4. <b>Section Title</b>
Some body text

The bold is recognized and converted, but the header is ignored, and the
line break is not inserted.  How is this possible?

Thanks, Dan
Af2ce6689213fdb78913a9662b18da6b?d=identicon&s=25 Rick Lloyd (ricklloyd)
on 2011-05-08 22:00
(Received via mailing list)
Dan,

I haven't scrubbed the code to see why but I know if I neglect to p<hut
a
blank line in before the *h4.* it will not be converted to
*<h4>...</h4>* in
the template an will instead be passed through as plain text to the
document.

I've observed this behavior at least back to 4.2.2 and found it to apply
as
well to other alphadot* *constructions (like* p.*).

Rick
Af2ce6689213fdb78913a9662b18da6b?d=identicon&s=25 Rick Lloyd (ricklloyd)
on 2011-05-08 22:15
(Received via mailing list)
Sorry, I set before I finished.

The right way appears to be:

BLANK LINE
h4. **Section Title**
BLANK LINE

Failure to end this construction with a blank line will cause whatever
following text (up to the next blank line) to be included in the *
<h4>...</h4>* construction in the template.

This behaviour differs from the paragraph formatting where no blank line
is
needed, only a single newline.

BLANK LINE
p. Lots and lots (many lines) of text.  The paragraph will only end with
the
first newline.

Hope that helps.
A50dcaaf8e545e6cc1fb4e32919be6ad?d=identicon&s=25 Jason Garber (jgarber)
on 2011-05-10 16:07
(Received via mailing list)
Sorry, I'm not able to follow your examples. Would you mind putting the
input in text files and attaching them. Hopefully that will work. You're
also welcome to use the redcloth command line tool and copy the input
and
output like so:

~ $ redcloth
This is a test of the h4:

h4. Lorem ipsum dolor sit amet

That's all. Thank you.
<p>This is a test of the h4:</p>
<h4>Lorem ipsum dolor sit amet</h4>
<p>That&#8217;s all. Thank you.</p>
~ $

You can send an EOF (which it waits for to send the output) by pressing
^D
(^Z on Windows)

I'm working on a rewrite of RedCloth and as part of that I will have a
form
to fill out to provide an example when making a bug report. Expect great
things soon!

Jason
02e20ca787ba0a92ebed761964d50c8e?d=identicon&s=25 Dan Lamet (dlamet)
on 2011-05-12 23:01
Attachment: DigiBunker_FAQ.txt (3 KB)
Sorry for the delay.  I was out sick.

Here's the source file as requested.  Note that this file worked fine,
and still does so on my posted RoR 2.x site at digibunker.com.  It's
only on my rebuilt RoR 3.x app that it fails.

Thanks, Dan
A50dcaaf8e545e6cc1fb4e32919be6ad?d=identicon&s=25 Jason Garber (jgarber)
on 2011-05-13 16:16
(Received via mailing list)
Thanks for sending over the file. Why is everything indented? Somehow,
it
still works. The output looks just fine to me on RedCloth 4.2.7

h4. <b>What is DigiBunker?</b>

DigiBunker is so simple and saves your files on a secure and private
server,
> meaning you get protection from hard drive failure, theft or property
> catastrophe.

h4. <b>How does DigiBunker save me money?</b>

We save you money by restoring your lost digital media at a minimal
cost. If
> you&#8217;ve invested hundreds or thousands of dollars on your digital media
> library, you wouldn&#8217;t want to have to spend the same amount of money
> to replace those files would you? Lets suppose you have a music library of
> about 500 songs, if you lost all of those songs, it would cost you $500 to
> replace them. DigiBunker will replace your songs for pennies on the dollar,
> literally.

 h4. <b>How does your service work?</b>

Our service offers you a program that identifies when you download a new
> music, movie, or video game, and will ask you if you want to pay to save the
> file from loss. You can also set our service to automatically back up all
> your digital media downloads to your computer without disrupting your
> computer use or system.

 h4. <b>How much does DigiBunker cost?</b>

DigiBunker cost pennies, literally! Our services are offered at a price
> that&#8217;s very affordable to you. Once you open an account, you choose
> how much to spend and what files you want to pay to save. There are no
> monthly fees, you can start your account with only a $10.00 minimum starting
> account balance. DigiBunker automatically Calculates your exact amount of
> media files you have to store and gives you the full price to store them.
> The cost is $.01 cents per music file and $1.00 per movie and video game and
> your photos are free up to 2GB.

 h4. <b>Can I view my saved files?</b>

Yes, you can see your saved files at

Digibunker.com any time you want. You can see the date they were save
and
> they are categorized by file type.

h4. <b>Can I retrieve single files?</b>

Yes, DigiBunker is a digital media file backup service that&#8217;s here
for
> you if you experience an extreme computer loss, such as a hard drive crash,
> theft or catastrophe. Think of as your guardian angel, you might need us for
> the small stuff, and we&#8217;ve definitely got your back when you really
> need a helping hand to replace your lost files.

 h4. <b>What do I do if I lose my digital files I have at
DigiBunker?</b>

It&#8217;s simple, you file a claim, pay a small processing fee and once
> we&#8217;ve received your request, you can select how you want to retrieve
> your files. You can retrieve them via download to your computer, or we will
> send you an external device to restore your files, which you simply return
> back to us once your finished re-installing your lost files.

 h4. <b>How long will you save my files?</b>

DigiBunker will save your files for 5 years from the date you chose to
save
> the file with us. You must renew your account every 5 years with a small
> renewal fee. You can also cancel your account at any time.

h4. <b>Are all my saved files private?</b>

Yes your files are private &#8230; DigiBunker will not observe your
files
> and we will never share your saved file information with any third party
> organization <span class="caps">PERIOD</span>.

 ~ $ redcloth --version

RedCloth 4.2.7
This topic is locked and can not be replied to.