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

Re^3: RFC - shortform posting guidance for newcomers (meh)

by luis.roca (Deacon)
on Jan 06, 2012 at 12:54 UTC ( [id://946594]=note: print w/replies, xml ) Need Help??


in reply to Re^2: RFC - shortform posting guidance for newcomers (meh)
in thread RFC - shortform posting guidance for newcomers

I think this <code></code> and <p></p> parser would be harder to implement than it seems (even keeping in mind your counter points). There are, as far as I have noticed, a fare share of questions that are of the: "I don't understand the difference between grep, map and foreach." written in paragraph form and peppered with keywords and/or small snippets of code. There is also the question of how do you parse out incorrect code/pseudo code.

I do think a short reminder above the poster's displayed previewed text is a decent idea worth exploring. Currently we have: "If something looked unlike you expected it to you might need to check out Writeup Formatting Tips" below the preview displayed post. Maybe that's not clear enough? If, as has been mentioned, the points are terse, few and clearly displayed above the preview, it could be helpful.


"...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote

Replies are listed 'Best First'.
Re^4: RFC - shortform posting guidance for newcomers (meh)
by afoken (Chancellor) on Jan 06, 2012 at 13:22 UTC
    I think this <code></code> and <p></p> parser would be harder to implement than it seems (even keeping in mind your counter points). [...] There is also the question of how do you parse out incorrect code/pseudo code.

    Does that parser have to be complete and perfect? All we want at this point is a simple check that the raw posting text contains one or more <p> and zero or more <code> or <c> tags. (Tags, not elements. We don't even have to check for the closing tags. Existing code handles missing or mis-placed tags quite well.) Unless that condition is met, the poster will see a hint that (s)he should check is posting. Implementing those checks could be done using one or two simple regexps.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      What you describe already exists (try posting something in plain text to see). Anything more will require another layer that delays/prevents a post from being submitted so - yes, it would need to be a /very/ good parser. A parser that would be much more work than would be worth the trouble considering SoPW doesn't seem to get more than a total of 25 questions per day.

      The handful of weekly "evil markup violators" can easily be handled with a quick private /msg with suggestions to improve their post. If they ignore it (which does happen), ignore the post and move on. ;-)


      "...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote
        Ignoring the bad markup isn't a complete solution. Janitors still are likely to be asked to fix it.

        As to posting plain text, I've never encountered difficulty including some... as in the case of the first (untagged) para in this node, nor in the case of a single sentence of narrative reply. (alternating paras with and without tags maintains readable rendering)

        Re the quality needed -- As my update, above, illustrates, coding a set of simple tests for the most egregious failures can be done even by he who frequently wears a dunce cap and without writing anything like a complete parser. If one wished to be more rigorous -- to correct ALL flaws -- then one of the html parsers should make an easy starting point.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-20 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found