Changeset 522673
- Timestamp:
- 03/23/2012 01:46:59 PM (14 years ago)
- File:
-
- 1 edited
-
latex/trunk/latex.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
latex/trunk/latex.php
r522668 r522673 1 1 <?php 2 2 /* 3 Plugin Name: LaTe xfor WordPress3 Plugin Name: LaTeX for WordPress 4 4 Plugin URI: http://wordpress.org/extend/plugins/latex/ 5 5 Description: Using MathJax and LaTex image service, this plugin provides a general solution to add and display your mathematical fourmula, no matter the visitors are visiting your blog or read from Google Reader. 6 Version: 3.4 6 Version: 3.41 7 7 Author: zhiqiang 8 8 Author URI: http://zhiqiang.org … … 114 114 $regex = '#\$\$(.*?)\$\$#si'; 115 115 116 $toParse = str_replace(array("\(", "\)", "\[", "\]", "[latex]", "[tex]", "[/latex]", "[/tex]"), array("$$", " $$", "$$!", " $$", "$$", " $$", "$$", "$$"), $toParse);116 $toParse = str_replace(array("\(", "\)", "\[", "\]", "[latex]", "[tex]", "[/latex]", "[/tex]"), array("$$", "$$", "$$!", "$$", "$$", "$$", "$$", "$$"), $toParse); 117 117 return preg_replace_callback($regex, array(&$this, 'createTex'), $toParse); 118 118 } … … 122 122 $formula_text = $toTex[1]; 123 123 $imgtext=false; 124 if(substr($formula_text, - 2) == "!") {124 if(substr($formula_text, -1) == "!") { 125 125 if (substr($formula_text, 0, 1) == "!") 126 return "<code class='tex2jax_ignore'>\[".substr($formula_text, 1, - 2)."\]</code>";126 return "<code class='tex2jax_ignore'>\[".substr($formula_text, 1, -1)."\]</code>"; 127 127 else 128 return "<code class='tex2jax_ignore'>\(".substr($formula_text, 0, - 2)."\)</code>";128 return "<code class='tex2jax_ignore'>\(".substr($formula_text, 0, -1)."\)</code>"; 129 129 } 130 130 if(substr($formula_text, 0, 1) == "!"){
Note: See TracChangeset
for help on using the changeset viewer.