Compare commits

...

2 Commits

Author SHA1 Message Date
7u83 bb37fc62bd Encodes & to & 2023-12-12 12:35:58 +01:00
7u83 89cf770472 Fixed module definition syntax error 2023-12-12 12:23:19 +01:00
1 changed files with 4 additions and 1 deletions

View File

@ -24,7 +24,7 @@ class TextFormatterLatexMathML extends Textformatter {
'title' => 'LatexMathML Text Formatter',
'version' => '0.9.1',
'summary' => 'Replaces $latexformula$ with inline MathML',
'author' = '7u83',
'author' => '7u83',
'autoload' => true,
'singular' => true,
'href' => 'https://git.planix.org/7u83/processwire-TextformatterLatexMathML',
@ -65,6 +65,8 @@ class TextFormatterLatexMathML extends Textformatter {
// unescape esaped $-signs
$modifiedValue = str_replace('\$', '$',$modifiedValue);
$modifiedValue = str_replace('&','&',$modifiedValue);
// Save the node and its modified content for later replacement
$nodesForReplacement[] = array(
'node' => $node,
@ -90,6 +92,7 @@ class TextFormatterLatexMathML extends Textformatter {
// Define a callback function to convert the matched formula to MathML
function convertToMathML($matches) {
$cache = wire('cache');
# $cache->deleteAll();
// $matches[1] contains the matched substring within '$'
$formula = $matches[1];