0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-01-23 05:41:53 +00:00

MOODLE-556: Renamed module Math to MathML

This commit is contained in:
Xavier Ripoll 2018-11-02 09:21:18 +01:00
parent a721ae0ae6
commit 42a6b32d5e
9 changed files with 20 additions and 16 deletions

View File

@ -238,7 +238,7 @@
<line>279</line>
</file>
</directive>
<directive id="HTML.Math">
<directive id="HTML.MathML">
<file name="HTMLPurifier/HTMLModuleManager.php">
<line>282</line>
</file>

View File

@ -162,7 +162,7 @@ require 'HTMLPurifier/HTMLModule/Iframe.php';
require 'HTMLPurifier/HTMLModule/Image.php';
require 'HTMLPurifier/HTMLModule/Legacy.php';
require 'HTMLPurifier/HTMLModule/List.php';
require 'HTMLPurifier/HTMLModule/Math.php';
require 'HTMLPurifier/HTMLModule/MathML.php';
require 'HTMLPurifier/HTMLModule/Name.php';
require 'HTMLPurifier/HTMLModule/Nofollow.php';
require 'HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
@ -192,7 +192,7 @@ require 'HTMLPurifier/HTMLModule/Tidy/XHTML.php';
require 'HTMLPurifier/Injector/AutoParagraph.php';
require 'HTMLPurifier/Injector/DisplayLinkURI.php';
require 'HTMLPurifier/Injector/Linkify.php';
require 'HTMLPurifier/Injector/MathSpaceNormalize.php';
require 'HTMLPurifier/Injector/MathMLSpaceNormalize.php';
require 'HTMLPurifier/Injector/PurifierLinkify.php';
require 'HTMLPurifier/Injector/RemoveEmpty.php';
require 'HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php';

View File

@ -156,7 +156,7 @@ require_once $__dir . '/HTMLPurifier/HTMLModule/Iframe.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Image.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Legacy.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/List.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Math.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/MathML.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Name.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/Nofollow.php';
require_once $__dir . '/HTMLPurifier/HTMLModule/NonXMLCommonAttributes.php';
@ -186,7 +186,7 @@ require_once $__dir . '/HTMLPurifier/HTMLModule/Tidy/XHTML.php';
require_once $__dir . '/HTMLPurifier/Injector/AutoParagraph.php';
require_once $__dir . '/HTMLPurifier/Injector/DisplayLinkURI.php';
require_once $__dir . '/HTMLPurifier/Injector/Linkify.php';
require_once $__dir . '/HTMLPurifier/Injector/MathSpaceNormalize.php';
require_once $__dir . '/HTMLPurifier/Injector/MathMLSpaceNormalize.php';
require_once $__dir . '/HTMLPurifier/Injector/PurifierLinkify.php';
require_once $__dir . '/HTMLPurifier/Injector/RemoveEmpty.php';
require_once $__dir . '/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php';

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
HTML.Math
HTML.MathML
TYPE: bool
DEFAULT: false
--DESCRIPTION--
<p>
MathML.</p>
Enable MathML.</p>
--# vim: et sw=4 sts=4

View File

@ -3,12 +3,12 @@
/**
* MathML 3 specification.
*/
class HTMLPurifier_HTMLModule_Math extends HTMLPurifier_HTMLModule
class HTMLPurifier_HTMLModule_MathML extends HTMLPurifier_HTMLModule
{
/**
* @type string
*/
public $name = 'Math';
public $name = 'MathML';
// Prefix in case MathML is imported
private $mathml_prefix = 'm';
@ -20,7 +20,7 @@ class HTMLPurifier_HTMLModule_Math extends HTMLPurifier_HTMLModule
{
// Normalize whitespace inside text elements as per MathML spec 2.1.7
$this->info_injector[] = new HTMLPurifier_Injector_MathSpaceNormalize();
$this->info_injector[] = new HTMLPurifier_Injector_MathMLSpaceNormalize();
/*****************************************************************
* Meta variables

View File

@ -279,8 +279,8 @@ class HTMLPurifier_HTMLModuleManager
if ($config->get('HTML.TargetNoopener')) {
$modules[] = 'TargetNoopener';
}
if ($config->get('HTML.Math')) {
$modules[] = 'Math';
if ($config->get('HTML.MathML')) {
$modules[] = 'MathML';
}
// merge in custom modules

View File

@ -1,6 +1,6 @@
<?php
class HTMLPurifier_Injector_MathSpaceNormalize extends HTMLPurifier_Injector
class HTMLPurifier_Injector_MathMLSpaceNormalize extends HTMLPurifier_Injector
{
/**

View File

@ -10,13 +10,13 @@
* W3C's MathML Test Suite. See:
* http://www.w3.org/Math/testsuite/build/mathml3tests.zip -> ErrorHandling folder
*/
class HTMLPurifier_HTMLModule_MathBasicTest extends HTMLPurifier_HTMLModuleHarness
class HTMLPurifier_HTMLModule_MathMLBasicTest extends HTMLPurifier_HTMLModuleHarness
{
public function setup() {
parent::setup();
$this->config->set('HTML.Math', true);
$this->config->set('HTML.MathML', true);
// We load each snippet and its purified version each into a
// separate XML document. This normalizes some self-closing