openlab-at-city-tech / webworkqa

WeBWorK integration for WordPress and BuddyPress
GNU General Public License v2.0
4 stars 2 forks source link

Problems containing html and css are rendered as text #32

Closed moui72 closed 7 years ago

moui72 commented 8 years ago

Problems containing html and css are rendered as text rather than the html and css being interpreted by the browser. Angled brackets are transformed to html entities (<, >).

misrendered htmlcss

latex seems to render correctly.

webwork url: http://mathww.citytech.cuny.edu/webwork2/WW-Dev/ParabolaVertices-CtS/1/?user=tpeckenpaugh&effectiveUser=tpeckenpaugh&key=yTNvez9EZ3wp5TWXvb1Gd1t6H7gmNOZb

openlabdev url: http://openlabdev.org/webwork-playground/?post_data_key=webwork_post_data_8b7b9cdad28720e1a57cb607f96bcfeb#/problem/local/ParabolaVertices/vertex-CtS-walkthrough.pg

Win7/Chrome 52+

boonebgorges commented 8 years ago

Thanks for the report. We need to come up with a whitelist of markup that is going to be interpreted, with the rest being stripped. For security and aesthetic reasons, we can't allow it all through blindly.

On 09/12/2016 02:18 PM, Tyler J. Peckenpaugh wrote:

Problems containing html and css are rendered as text rather than the html and css being interpreted by the browser. Angled brackets are transformed to html entities (|<|, `>).

misrendered htmlcss https://cloud.githubusercontent.com/assets/3885628/18449155/239760be-78fc-11e6-8593-4621845fe46e.png

latex seems to render correctly

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/livinglab/webwork-for-wordpress/issues/32, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPDY2RGicbuFW39_IuIP9DprUNONHHiks5qpaWPgaJpZM4J67rg.

drdrew42 commented 8 years ago

Just to clarify, which set and problem number is this coming from?

boonebgorges commented 8 years ago

URLs from both WW and from WP would be helful in this case (and most cases!)

On 09/12/2016 03:41 PM, drdrew42 wrote:

Just to clarify, which set and problem number is this coming from?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/livinglab/webwork-for-wordpress/issues/32#issuecomment-246485659, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPDY-hmvVLTsohHR7W-YHntC-JTkP_Iks5qpbkNgaJpZM4J67rg.

moui72 commented 8 years ago

I added URLs to the original post and repeat them below

webwork url: http://mathww.citytech.cuny.edu/webwork2/WW-Dev/ParabolaVertices-CtS/1/?user=tpeckenpaugh&effectiveUser=tpeckenpaugh&key=yTNvez9EZ3wp5TWXvb1Gd1t6H7gmNOZb

openlabdev url: http://openlabdev.org/webwork-playground/?post_data_key=webwork_post_data_8b7b9cdad28720e1a57cb607f96bcfeb#/problem/local/ParabolaVertices/vertex-CtS-walkthrough.pg

bree-z commented 8 years ago

Would it be useful to add URLs here if we encounter any additional instances of this problem, other than what Tyler reports above?

Thanks!

boonebgorges commented 8 years ago

Hi Bree - Sure, feel free to list additional links if they demonstrate different kinds of parse failures (ie, different tags)

On 09/13/2016 11:31 AM, bree-z wrote:

Would it be useful to add URLs here if we encounter any additional instances of this problem, other than what Tyler reports above?

Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/livinglab/webwork-for-wordpress/issues/32#issuecomment-246741615, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPDY7ey8tecdQX53iuHIjSONR64gsxZks5qps_ogaJpZM4J67rg.

bree-z commented 8 years ago

Ok, will do if I see any. Thanks!

bree-z commented 8 years ago

Hi Boone - Not sure 8if this is helpful, but here's a problem with ol and ul tags:

openlabdev URL: http://openlabdev.org/webwork-playground/#/problem/local/CompoundInterest/different-rates.pg/question-11108

WW URL: http://mathww.citytech.cuny.edu/webwork2/WW-Dev/CompoundInterest/1/?user=bzuckerman&key=OWiBHhKJsOALZni3oiA9rIJBanglOd2k&effectiveUser=bzuckerman

moui72 commented 8 years ago

Here's my best effort to categorize the problems with special rendering needs

type description ol url ww url
image problem contains an image GraphingSineCosine GraphingSineCosine
scaffold problem is scaffolded ParabolaVertices-CtS ParabolaVertices-CtS/
multipart problem requires more than one answer CompoundInterest CompoundInterest
boonebgorges commented 8 years ago

I've got most of this working. Here are some examples:

drdrew42 commented 8 years ago

These are all working for me - with one small exception.

For the third bullet: when this question is pulled over to the OL site, it seems as though the "sin(x)" and "cos(x)" are being stripped from the first question below the graph.

What should appear is "Does this graph have the shape of \sin(x) or \cos(x) ? " But what's appearing instead is "Does this graph have the shape of or ? "

boonebgorges commented 8 years ago

Thanks @drdrew42 - I will look into it.

On 09/20/2016 08:40 AM, drdrew42 wrote:

These are all working for me - with one small exception.

For the third bullet: when this question is pulled over to the OL site, it seems as though the "sin(x)" and "cos(x)" are being stripped from the first question below the graph.

What should appear is "Does this graph have the shape of \sin(x) or \cos(x) ? /" But what's appearing instead is "Does this graph have the shape of or ? /"

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/livinglab/webwork-for-wordpress/issues/32#issuecomment-248304069, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPDY03hPlPj7n1xpJXUTI0NrTu4dw6Uks5qr-IxgaJpZM4J67rg.

moui72 commented 8 years ago

Looking good for the ones I've gotten to.

One comment about the scaffold ones (e.g. http://openlabdev.org/webwork-playground/#/problem/local/ParabolaVertices/vertex-CtS-walkthrough-fractions.pg/question-11080), I wonder if we should/could change the yellow background of the section headers to be either blue or black (with white text) so it fits in a bit better.

I include the css suggestion below mostly just to blame the class definition that is giving us the yellow color.

e.g.

.canopen {
    background: yellow!important;
}

might become

.canopen {
  background-color: #0044af;
  color: #fff;
  font-weight: 600;
}
boonebgorges commented 7 years ago

@moui72 - Yeah, I agree that somithng should be done about the colors :) Let's talk this over briefly during tomorrow's meeting.

moui72 commented 7 years ago

In general, @boonebgorges, would you rather we report markup issues here or make new issues? E.g. #50 should maybe have been part of this thread?

boonebgorges commented 7 years ago

Start new issues. These massive threads lead to reports getting lost. In fact, let's close this one.