Page MenuHomePhabricator

Script tag within p, which may cause incorrect Facebook snippet
Closed, ResolvedPublic

Description

Boozerker reported on English Wikipedia VPT that Facebook was displaying JavaScript code as a snippet when people share a fundraising page (https://donate.wikimedia.org/wiki/Special:FundraiserLandingPage?uselang=en&appeal=Appeal-Sengai). I saw in the source that the script element was inside a paragraph:

<p>
<script type="text/javascript">
$( document ).ready( function () {

// Disable submitting form with return key
$( 'form' ).bind( 'keypress', function(e) {
  var code = ( e.keyCode ? e.keyCode : e.which );
  if ( code == 13 ) return false;
} );

} );
</script>

I don't know for sure if this is causing the incorrect Facebook snippet. But it might be, and this could cause other issues.


Version: unspecified
Severity: normal

Details

Reference
bz34660

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:11 AM
bzimport set Reference to bz34660.

We have head elements inside body there.

Anybody willing to share this on Facebook to retest this, as it's that fundraising time of the year again? :)

Resetting the assignee/status of this issue to default because there has been no progress in the last 12 months. Feel free to take it again when you are actually planning to fix this. Thanks.

Pcoombe claimed this task.

Checked with Facebook's debugger (https://developers.facebook.com/tools/debug/og/object/) and couldn't reproduce this anymore.