Disable BBcode encoding within a latex tag
Hello, I have the following bb function
function bb($string) {
$string = trim($string);
$search = array(
'@\<(?i)latex\>(.*?)\</(?i)latex\>@si',
'@\<(?i)b\>(.*?)\</(?i)b\>@si',
'@\<(?i)i\>(.*?)\</(?i)i\>@si',
'@\<(?i)u\>(.*?)\</(?i)u\>@si',
'@\<(?i)blockquote\>(.*?)\</(?i)blockquote\>@si',
'@\<(?i)pre\>(.*?)\</(?i)pre\>@si'
);
$replace = array(
'<img src="cgi/mathtex.cgi?\\1">',
'<b>\\1</b>',
'<i>\\1</i>',
'<u>\\1</u>',
'<blockquote>\\1</blockquote>',
'<pre>\\1</pre>'
);
$string = strtr($string, array("\n" => '<br>'));
$string = preg_replace($search ,$replace, $string);
return $string;
}
The problem is that if one enters newlines within latex tags (to make latex more clearly arranged), the function replaces the \n
by <br>
, which then becomes of course invalid latex code.
How to disable the encoding of code which is within latex tags?
View Answers
October 6, 2012 at 12:01 AM
Ads
Related Tutorials/Questions & Answers:
Disable BBcode encoding within a latex tag
Disable BBcode encoding within a
latex tag Hello, I have... invalid
latex code.
How to
disable the
encoding of code which is
within latex tags... is that if one enters newlines
within latex tags (to make
latex more clearly
Set encoding from within SQL*Plus
Set
encoding from
within SQL*Plus Hi,
In Oracle server I am running sql query from sqlplus which is adding Spanish data. But data is converted wrongly due to UTF conversion.
How to resolve this.
Thanks
Hi,
Run
Advertisements
ModuleNotFoundError: No module named 'bbcode'
ModuleNotFoundError: No module named '
bbcode' Hi,
My Python... '
bbcode'
How to remove the ModuleNotFoundError: No module named '
bbcode'... to install padas library.
You can install
bbcode python with following command
ModuleNotFoundError: No module named 'mde_bbcode'
ModuleNotFoundError: No module named 'mde_
bbcode' Hi,
My Python... 'mde_
bbcode'
How to remove the ModuleNotFoundError: No module named 'mde_
bbcode' error?
Thanks
Hi,
In your python environment you
disable function
disable function Sir,
I have called a java script function when one radio button is checked i want to
disable this function when another radio button is checked ,both radio buttons are of same group
Please help
Thanks in advance
ModuleNotFoundError: No module named 'latex'
ModuleNotFoundError: No module named '
latex' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
latex'
How to remove the ModuleNotFoundError: No module named '
latex'
ModuleNotFoundError: No module named 'latex'
ModuleNotFoundError: No module named '
latex' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
latex'
How to remove the ModuleNotFoundError: No module named '
latex'
ModuleNotFoundError: No module named 'latex'
ModuleNotFoundError: No module named '
latex' Hi,
My Python program is throwing following error:
ModuleNotFoundError: No module named '
latex'
How to remove the ModuleNotFoundError: No module named '
latex'
Struts2.2.1 treenode Tag Example
Struts2.2.1 treenode
Tag Example
The tree & treenode tag render a tree node
within a tree widget
with AJAX support.The tree & treenode... to implement the tree & treenode
tag
in the Struts2.2.1 --
Directory
disable keyboard in java applet
disable keyboard in java applet How to
disable key board of my client in an java applet embedded in a website while the applet is running.? Plz help