In Pod::Html version 1.03, the process_puretext function does this:
# convert double-quotes to single-quotes
if( $$quote && $text =~ s/"/''/s ){
$$quote = 0;
}
while ($text =~ s/"([^"]*)"/``$1''/sg) {};
$$quote = 1 if $text =~ s/"/``/s;
Now I understand what each statement does, but can't figure out how it works! The first regex will find the first (") char and turn it into a pair of single quotes. The /s modifier is superfluous.
The second will find pairs of double quotes and replace the first with backticks and the second with two singles.
Then any remaining ("), if there were an odd number (even to begin with since the first was already taken) that last one is converted to backticks.
So... I'm reading that
stuff "passage one" more stuff "passage two" stuff
would convert the first one to close quotes, then pairs with open/close, then the last to open.
stuff ''passage one`` more stuff ''passage two`` stuff
Isn't that backwards?
—John
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.