Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^12: BUG: code blocks don't retain literal formatting -- could they?

by perl-diddler (Chaplain)
on Sep 21, 2016 at 02:23 UTC ( [id://1172266]=note: print w/replies, xml ) Need Help??


in reply to Re^11: BUG: code blocks don't retain literal formatting -- could they?
in thread BUG: code blocks don't retain literal formatting -- could they?

Well, I'd love to try an experiment -- disabling the conversion of user-input characters in "Code" blocks on user-submission, into HTML entities. Seems like that shouldn't be "that" hard.

BTW -- when I say website directing conversion -- I mean by claiming it is using a specific encoding. Certainly Win-1251 was never a default standard -- ISO-8859-1, maybe, but not Win-1251 -- so that has to be specified as an encoding by the website on each page. That's what I mean by "directing conversion". The fact that multiple people can read UTF-8 encoded Unicode characters (basically ignoring the website's encoding directive) leads me to believe that most browsers would automatically work -- and it is only the fact that PM, first converts user-input into html-entities that the problem exists -- because it is only in code-blocks that PM won't convert html-entities or inhibits browser conversion back into their character equivalents.

That 2nd conversion makes UTF-8 displayable in normal text or "pre" blocks, but is disabled for "code" blocks. The best solution there would be to not mangle user-input in "code" blocks in the first place into html entities -- because they won't be converted back into displayable characters -- it's a one-way conversion that is causing the display bug -- so since "code" blocks aren't supposed to be formatted anyway -- it seems having the website reformat user input in those blocks is the root of the problem, since any conversion done in that 1st stage will be guaranteed to be one-way in code blocks.

Replies are listed 'Best First'.
Re^13: BUG: code blocks don't retain literal formatting -- could they?
by RonW (Parson) on Sep 21, 2016 at 23:02 UTC
    Well, I'd love to try an experiment -- disabling the conversion of user-input characters in "Code" blocks

    Supposedly, that conversion is happening in the browser (for the whole submission).

    It is possible to prove (or disprove) that by using WireShark (or similar) program to monitor what the browser is sending to PM.

    DANGER: The following idea might get you in trouble with the PM Gods

    Another possible experiment would be to manually create a form submission (see Form submission), including the proper values and attributes for Content-type and Content-Transfer-Encoding for the text area. Then use HTTP::Tiny to post it to PM.

    Important: If you do the above, be sure the value of the "op" field is "preview".

    Then you can examine the response content to see how badly PM choked on the submission.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-28 16:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found