Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-21407 tex filter - trim leading whitespace from latex preamble

  • Loading branch information...
commit 16421d03536e631664ca03310f0551df9260528b 1 parent a97f193
@stronk7 stronk7 authored
View
3  filter/tex/filtersettings.php
@@ -5,10 +5,9 @@
$items = array();
$items[] = new admin_setting_heading('filter_tex_latexheading', get_string('latexsettings', 'admin'), '');
$items[] = new admin_setting_configtextarea('filter_tex_latexpreamble', get_string('latexpreamble','admin'),
- '', " \\usepackage[latin1]{inputenc}\n \\usepackage{amsmath}\n \\usepackage{amsfonts}\n \\RequirePackage{amsmath,amssymb,latexsym}\n");
+ '', "\\usepackage[latin1]{inputenc}\n\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\RequirePackage{amsmath,amssymb,latexsym}\n");
$items[] = new admin_setting_configtext('filter_tex_latexbackground', get_string('backgroundcolour', 'admin'), '', '#FFFFFF');
$items[] = new admin_setting_configtext('filter_tex_density', get_string('density', 'admin'), '', '120', PARAM_INT);
-$items[] = new admin_setting_configtext('filter_tex_density', get_string('density', 'admin'), '', '120', PARAM_INT);
if (PHP_OS=='Linux') {
$default_filter_tex_pathlatex = "/usr/bin/latex";
View
8 lib/db/upgrade.php
@@ -3328,6 +3328,14 @@ function xmldb_main_upgrade($oldversion=0) {
upgrade_main_savepoint($result, 2007101571.03);
}
+ // MDL-21407. Trim leading spaces from default tex latexpreamble causing problems under some confs
+ if ($result && $oldversion < 2007101571.04) {
+ if ($preamble = $CFG->filter_tex_latexpreamble) {
+ $preamble = preg_replace('/^ +/m', '', $preamble);
+ set_config('filter_tex_latexpreamble', $preamble);
+ }
+ }
+
return $result;
}
View
2  version.php
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
- $version = 2007101571.03; // YYYYMMDD = date of the 1.9 branch (don't change)
+ $version = 2007101571.04; // YYYYMMDD = date of the 1.9 branch (don't change)
// X = release number 1.9.[0,1,2,3,4,5...]
// Y.YY = micro-increments between releases
Please sign in to comment.
Something went wrong with that request. Please try again.