MDL-21407 tex filter - trim leading whitespace from latex preamble
This commit is contained in:
@@ -5,10 +5,9 @@ require_once($CFG->dirroot.'/filter/tex/lib.php');
|
||||
$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";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user