Skip to content

Commit

Permalink
v1.32.1: bugfixes for mse172931 and mso297489, update mse229363 regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
vyznev committed Aug 13, 2015
1 parent ac7c72b commit 58588fa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ This is mainly a cleanup release, removing several obsolete fixes for design bug
* Documentation fix: The [mse243519](http://meta.stackoverflow.com/q/243519) fix was mistakenly identified as [mse240790](http://meta.stackoverflow.com/q/240790) (and linked to the wrong post).
* Tweaked [math4130](http://meta.math.stackexchange.com/q/4130) fix to hopefully be more robust.

**Changes in 1.32.1:**

This point release fixes a few minor bugs that crept into 1.32.0:

* [mse172931](http://meta.stackexchange.com/q/172931): Strip `<script>` tags from the async-loaded question page more cleanly, to avoid accidentally parsing their content as HTML.
* [mse229363](http://meta.stackexchange.com/q/229363): Hot question titles from [Data Science](http://datascience.stackexchange.com) Stack Exchange are now eligible for MathJax parsing.
* [mso297489](http://meta.stackoverflow.com/q/297489): Fix a regexp typo causing the "close" link to sometimes appear only after the review page is reloaded.


1.30 (22 Jun 2015)
====
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- thumbnail: http://i.stack.imgur.com/8EphO.png -->
<!-- version: 1.32.0 -->
<!-- version: 1.32.1 -->

![](http://i.stack.imgur.com/IzzhJ.png "SOUP logo")

Expand Down
2 changes: 1 addition & 1 deletion SOUP.meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace https://github.com/vyznev/
// @description Miscellaneous client-side fixes for bugs on Stack Exchange sites
// @author Ilmari Karonen
// @version 1.32.0
// @version 1.32.1
// @copyright 2014-2015, Ilmari Karonen (http://stackapps.com/users/10283/ilmari-karonen)
// @license ISC; http://opensource.org/licenses/ISC
// @match *://*.stackexchange.com/*
Expand Down
11 changes: 7 additions & 4 deletions SOUP.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @namespace https://github.com/vyznev/
// @description Miscellaneous client-side fixes for bugs on Stack Exchange sites
// @author Ilmari Karonen
// @version 1.32.0
// @version 1.32.1
// @copyright 2014-2015, Ilmari Karonen (http://stackapps.com/users/10283/ilmari-karonen)
// @license ISC; http://opensource.org/licenses/ISC
// @match *://*.stackexchange.com/*
Expand Down Expand Up @@ -551,7 +551,10 @@ fixes.mse172931 = {

var injectAnswers = function ( html ) {
// kluge: disable script tags; $.parseHTML() would be better, but needs jQuery 1.8+
var answers = $( html.replace( /(<\/?)(script)/ig, '$1disabled$2' ) ).find('.answer').filter( function () {
// (we do this in two passes: the first is cleaner, but could potentially miss some cases)
html = html.replace( /<script\b([^>'"]+|"[^"]*"|'[^']*')*>[\s\S]*?<\/script\s*>/ig, '' );
html = html.replace( /(<\/?)(script)/ig, '$1disabled$2' );
var answers = $( html ).find('.answer').filter( function () {
return ! document.getElementById( this.id );
} ), n = answers.length;
SOUP.log( 'soup loaded ' + n + ' missing answers from ' + url );
Expand Down Expand Up @@ -833,7 +836,7 @@ fixes.mso297489 = {
title: "Add close option to the “Help and Improvement” queue to avoid cluttering flags?",
url: "http://meta.stackoverflow.com/q/297489",
script: function () {
if ( ! /^\/review\/helper\/\b/.test( location.pathname ) ) return;
if ( ! /^\/review\/helper\b/.test( location.pathname ) ) return;
SOUP.hookAjax( /^\/review\/(next-task|task-reviewed)\b/, function () {
StackExchange.vote_closingAndFlagging.init();
$('.post-menu .close-question-link').show();
Expand Down Expand Up @@ -1151,7 +1154,7 @@ fixes.mse229363 = {
mathjax: function () {
// list of MathJax enabled sites from http://meta.stackexchange.com/a/216607
// (codereview.SE and electronics.SE excluded due to non-standard math delimiters)
var mathJaxSites = /(^|\.)((astronomy|aviation|biology|chemistry|cogsci|crypto|cs(theory)?|dsp|earthscience|engineering|ham|math(educators|ematica)?|physics|puzzling|quant|robotics|scicomp|space|stats|worldbuilding)\.stackexchange\.com|mathoverflow\.net)$/;
var mathJaxSites = /(^|\.)((astronomy|aviation|biology|chemistry|cogsci|crypto|cs(theory)?|(data|earth)science|dsp|engineering|ham|math(educators|ematica)?|physics|puzzling|quant|robotics|scicomp|space|stats|worldbuilding)\.stackexchange\.com|mathoverflow\.net)$/;
MathJax.Hub.Register.MessageHook( "Begin PreProcess", function (message) {
SOUP.try( 'mse229363', function () {
$('#hot-network-questions a:not(.tex2jax_ignore)').not( function () {
Expand Down

0 comments on commit 58588fa

Please sign in to comment.