Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Creating node should automatically add "<br>"

by DrWhy (Chaplain)
on Nov 26, 2004 at 16:46 UTC ( [id://410601]=note: print w/replies, xml ) Need Help??


in reply to Creating node should automatically add "<br>"

Although I would tend to agree that coddling PM newbies too much encourages delayed development -- kind of like what's happening with the delayed emotional and ethical maturation of the rich, coddled, overprotected recent generations in North America and Western Europe (probably Japan too, though perhaps to a lesser degree) -- that doesn't mean that there isn't a reasonable possiblity here for making our lives simpler without taking away power and flexibility when that is desired. Although, I haven't been bothered too much by poorly formated node, I personally find it annoying to have to be throwing <p>'s in all over the place just to get separate paragraphs when the text I'm writing requires no special formatting.

I would suggest the following. A checkbox is added next to the textarea for creating new nodes. If checked the text is assumed to be 'plaintext' with no HTML in it. It gets filtered according to a very simple set of rules:

  1. Anything that looks like HTML gets escaped (>, <, &, etc.)
  2. All newlines are converted to <br />
The text thus filtered would be what gets stored in PM. This plaintext option would not be available for updating nodes, only for node creation, since in most cases some HTML would have already been added to the plaintext node by the system.

Advantages:

  • Simple posts can be composed more simply.
  • Minimal extra overhead on PM, only an extra if for each new node posted, plus a one time filtering operation for 'plaintext' nodes. Well, actually the /if( and filtering)?/ would have to happen at least twice for each new node, because you would want to filter the 'preview' version as well.
  • Experienced users need do nothing different to continue to have their same old user experience.
  • In order to be 'lazy', you have to click a check box, a slight barrier to grauitous laziness. The truly lazy and inconsiderate will still end up posting poorly formatted stuff.
  • Very limited rules for plaintext processing gives, I think, maximum benefit for posters who know they are just writing simple block paragraph text, while keeping the required code changes on the backend comparatively simple and small -- especially important is that this doesn't change the way nodes are stored or displayed to readers.
  • Although I envision this as a labor saving device for users with more experience rather than less, an intelligent newbie should be able to take advantage of the feature too in short order, if they don't feel ready to do HTML.
  • If the checkbox is properly labelled, it would be a clue to true newbies that the text they are putting in will be treated like HTML by default.
Disadvantages:
  • Some purists may be annoyed. To them I say, systems are designed for people, not people for systems. (I was going to say that the luddites would also be annoyed, but since this doesn't actually require them to change their behavior in any way, I would think they wouldn't be bothered too much.)
  • This will of course require more coding work on the PM scripts than not doing anything would.
--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://410601]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-20 02:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found