Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
"What?". What?

That was A joke.

They say a joke isn't funny if it needs explaining?

The issue regarding having to insert html code for paragraph breaks. I have difficulty understanding why, in a forum run by Perl programmers, I assume, or guess, probably coded in Perl, (I can't do view source on this Android device, but I assume) built by Perl programmers with Perl. such a nuisance issue, or issue about a nuisance exists.

It looks like I'm not the first to bring this up. People have been complaining, and implementing work arounds for what looks like maybe decades. Making templates, and yours. Which I haven't gotten working.

Posting in a forum involves CGI. (I assume I don't have to explain this, but anyway..) "Common Gateway Interface" (not computer generated imagery) Most often, at least in the old days, and, I'm guessing this forum was established long ago... Posts made to any kind of Perl forum were processed with the CGI.pm Perl module which handles the translation of the URL encoding in which the post is sent over the internet back into readable text. Splits on =, Replaces + with spaces and all that.

A post to this forum, or any forum, is sent across the internet URL encoded.

When it is received by the program it is posted to, by the forum, by PerlMonks.org's backend: (alert! URL coded text ahead)

text=The+program+receives+the+text+URL+encoded+which+
looks+like+this+text+here.+Spaces+are+%2B+plus+signs
+and+special+characters+are+changed+%23%24%40%26%2B-%25*
+like+that

CGI.pm puts it (the URL encoded text) back to normal. So it can be read.

In most forums, newline character, (the return for paragraph breaks) which don't render in html are converted to html paragraph breaks or BR or something so that they do.

I would assume the reason this hasn't been fixed long ago, is because the "gods" are just having some fun. Certainly it's not because nobody knows how to do a substitution. It must be some kind of joke right?

So I got to thinking, if we are going to NOT do the substitution to change the text input newline to html paragraph or line breaks. If someone thinks that's such a gas, well it would be loads more fun if we didn't bother with reversing the URL encoding either. (Try reading the following)

text=Then+all+the+posts+in+here%2C+besides+not+having
+paragraph+breaks+to+make+posts+harder+to+read+and+be+a+royal+
pain+in+the+ars%27s+the+URL+encoding+wouldn%27t
+be+striped+either+and+we+could+have+fun+trying+to+fix+that+
without+access+to+the+server.+What+fun+right%3F%3F%3F

In other words, the text is going through a lot of processing anyway, on the server, to strip out the URL encoding, perform split and do replacements. Text processing is what Perl excells at. Why not be processing paragraph breaks to be what they are or should be? It's not dangerous.

Tom


In reply to Re^6: Making Perl Monks a better place for newbies (and others) by PerlGuy(Tom)
in thread Making Perl Monks a better place for newbies (and others) by ELISHEVA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-19 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found