Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP Disable BBcode encoding within a latex tag
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Klaus
Disable BBcode encoding within a latex tag
1 Answer(s)      2 years and 4 months ago
Posted in : PHP


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?


Advertisement
View Answers

October 6, 2012 at 12:01 AM


fixed!



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
nsstring encoding types
nsstring encoding types   What is NSString Encoding Type in XCode
Advertisements
URL Encoding and URL Decoding
URL Encoding and URL Decoding  What is URL Encoding and URL Decoding ?   URL encoding is the method of replacing all the spaces and other extra characters into their corresponding Hex Characters and Decoding
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
Output Encoding - JSP-Servlet
Output Encoding  From security vulnerability perspective, we?d like to perform output encoding of special characters (ex: < > ? ? % ; ( ) & +) on JSP while displaying pages.How can this be achieved ? Can we achieve
uikeyboard disable return key
uikeyboard disable return key  uikeyboard - hot to disable return key
enable disable checkbox in javascript
enable disable checkbox in javascript  How to enable disable checkbox in javascript
How to disable an HTML object?
How to disable an HTML object?  How to disable an HTML object
HTTP URL Address Encoding in Java
HTTP URL Address Encoding in Java  HTTP URL Address Encoding in Java
Setting the default Java character encoding?
Setting the default Java character encoding?  Setting the default Java character encoding
Java file encoding
Java file encoding In this section, you will learn how to get the file encoding. Description of code: An encoding is a mapping between a byte value and its... stream and called its method getEncoding() which returns the desired encoding
White Space encoding problem in PDF
White Space encoding problem in PDF  I am reading PDF version 1.3 using iText. Things are fine but with one problem that is I am not able to get whitespace. Is there any problem in whitespace encoding in PDF version 1.3
Disable UITableView Scrolling
Disable UITableView Scrolling   How to disable the UITableView Scrolling either programmatically or in XIB
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
Character encoding problem with chinese language
Character encoding problem with chinese language  I have a issue with characters in chinese locale in java. Iam using eclipse IDE My code is "java.util.Date stdDate = new SimpleDateFormat("dd/MM/yyyy").parse(10/10/2012); String
enable disable table
enable 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
JSP URL Encoding
JSP URL Encoding          JSP URL Encoding is used to encode the url in JSP. URL Encoding is the process of converting string into valid URL format
uitextfield disable keyboard
uitextfield 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
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 and enable the submit buttons
disable and enable the submit buttons  i have two summit button in my form. one is disabled and other is navigating to the other page. after 3 submissions of the submit button the disabled one must be enabled and the enabled one
code to disable back button of browser
code to disable back button of browser  code to disable back button of browser
code to disable back button of browser
code to disable back button of browser  code to disable back button of browser
Disable of Combo - JSP-Servlet
Disable of Combo  Hi! Thanks for your fast reply. In my project i am giving grading facility to the user. Once user selected his grade in combo.... That means every user can give grade only at once... so i would like to disable
disable the form - JSP-Servlet
disable the form  Hi All, I'm developing a small application. I wrote jsp page in that 8 forms are there.all forms are same but the input values... that particular button disable by using document.formname.buttonname.disable = true
Nest tables within tables
Nest tables within tables  Can I nest tables within tables
how to disable browser back button
how to disable browser back button  Am doing a web application in that how to disable browser back button using java script
Facelet remove Tag
Facelet remove Tag          This tag is used to remove content within this tag  from a facelet at compile time. This tag don't have any
error within servlet
error within servlet  List leagueList=(List).context.getAttribute("leagueList"); this is one line in my servlet code. but i have error with this line. The error is.... illegal start of type. Cannot find symbol. Symbol:variable
Facelet define Tag
. This named content can be included within a template. This tag is used within... is given value "face1". So the content within define tag, whose name...Facelet define Tag      
How to Disable Catch-all Emails on CPanel
How to Disable Catch-all Emails on CPanel  Hi, How to disable catch all emails setting on CPanel? Thanks
How to disable task manager using java
How to disable task manager using java  How to disable task manager using java
Advertisements
 

 

 

DMCA.com