ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > PopUp Wisdom

Parsing of Fortune Files

(1/3) > >>

transitionality:
I am having some trouble with the parsing of fortune files.

First off, I note that I like to have a blank line separating the quote from the speaker, as follows:

"The time you enjoy wasting is not wasted time."

-- Bertrand Russell

%

.....

--- End quote ---

However, Popup Wisdom displays such formatting as follows:

"The time you enjoy wasting is not wasted time."
-- Bertrand Russell

--- End quote ---

So I tried putting a space on the blank line separating the quote from the speaker.

"The time you enjoy wasting is not wasted time."
(there's one space here)
-- Bertrand Russell

%

.....

--- End quote ---

But Popup Wisdom displays such a quote as follows:

"The time you enjoy wasting is not wasted time."
 -- Bertrand Russell

--- End quote ---

In other words, it ignores the line with the single space on it, and concatenates the space with the content of the line following it, displaying the result on one line.

Now, I know that I can always try and convert my quotes file to Popup Wisdom's own format to get the precise formatting that I want, but that's a lot of work, especially for multi-line, oddly formatted quotes. I haven't figured out a way to automate the conversion. I'd much rather be able to use fortune format.

I'm also not sure if the above is buggy or expected behavior, not being intimately familiar with the fortune format specification. Nor am I sure if there is a way to get the behavior that I want using the fortune format.

I am open to ideas and suggestions. Thanks.

mouser:
let me see if i can't fix this to respect newlines in fortune files that use the % format to separate items.

transitionality:
Like I said, I'm not sure what the specification is. I wouldn't want to cause you to fall out of spec merely to convenience me. But if it is within spec, that would be great.

mouser:
my memory is (and it's been a while since i worked on this), that popup wisdom knows how to read 2 kinds of fortune file formats.

one involves each quote on its own line.  in such a case youd have to use \n to indicate a newline -- no real option there.
the other format uses % signs to separate fortunes.  there is no reason that it shouldn't respect newlines in such a case.

transitionality:
See here for some more detail, under "Cookie-Jar Format".

Apparently %% is a valid delimiter too, so maybe you could support that as well?

Navigation

[0] Message Index

[#] Next page

Go to full version