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
Related Tutorials/Questions & Answers:
Disable BBcode encoding within a latex tagDisable 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*PlusSet
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
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'
disable functiondisable 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
JSF verbatim Tag of this
tag. This
tag can
be used to nest plain html
within the JSF component tree. Any Html and jsp tags
in the view
tag can be nested
within verbatim
tag. The reason...JSF verbatim
Tag
disable keyboard in java appletdisable 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
enable disable tableenable
disable table hi
I have table with 3 columns if i click one column the other 2 column should
disable pls can anyboby help me
uitextfield disable keyboarduitextfield
disable keyboard How to
disable keyboard of UITextView in iPhone SDK application?
There are two ways to
disable the keyboard...)];
[self.view addSubview:pv];
return NO;
}
//or simply
disable