bbcode

How to show <?php tags in BBCode?

Is it possible to show <?php and ?> tags in BBCode? I know about the [code] and [php] tags, but these still strip out any code blocks that contain things like: <?php echo "myvalue" ?> Thanks for any ideas. ...

Javascript Not Parsing Nested Bbcode

I have coded a Javascript bbcode similar to the one I'm using to write this message. It also incorporates a live preview box like the one I see below. The only problem I'm facing at the moment is that some nested bbcode is not parsing. For example: [quote] [quote][/quote] [/quote] Is not parsing correctly. This is my Javascript c...

vBulletin BBCode on external page.

Hello, I integrated my vBulletin with custom front page. I'm wondering, how could I use vBulletin BBcode on that page (I'm displaying some posts there). Any suggestions? ...

Trigger function when mouse click inside textarea AND type stop typing...

Welcome, In short, my website use BBcode system, and i want allow users to preview message without posting it. I'm using JQuery library. I need 3 actions. 1) When user click in textarea i want display DIV what will contain preview, i want animate opening. 2) When user typing, i want dynamical load parsed by PHP code to DIV. (i'm sti...

How to remove BB codes from a string?

How to get ride of all BBcodes in a string but keep the content? Example: [B]This is bold[/B] and This is [color=#FFCCCC]colored[/color] Will be : This is bold and This is colored ...

How to parse bbcodes safely?

I'm trying to parse BBcodes in php but i don't think my code is safe at all. $Text = preg_replace("(\[color=(.+?)\](.+?)\[\/color\])is","<span style=\"color: $1\">$2</span>",$Text); I think you can pass an injection like this and it will work: [color=<script>alert('gotcha');</script>]...[/color] How to improve my regex to only cap...

How convert html to BBcode in C#

Hello! I need to convert html text into bbcodes. Where i can find how should i do this? For example, I convert links: regex = new Regex("<a href=\"(.+?)\">(.+?)</a>"); htmlCode = regex.Replace(htmlCode, "[URL]$1[/URL]"); How can i convert all html tags in bbcodes (and replace to empty which isn't bb codes, tag P ...

Javascript BBCode Parser recognizes only first list element

I have a really simple Javascript BBCode Parser for client-side live preview (don't want to use Ajax for that). The problem ist, this parser only recognizes the first list element: function bbcode_parser(str) { search = new Array( /\[b\](.*?)\[\/b\]/, /\[i\](.*?)\[\/i\]/, /\[img\](.*?)\[\/img\]/, /\[url\="?(.*?...

Markup filter wanted for a public website

Developing a community site where everyone can post text, I'm looking for a markup filter: What is not part of the markup must be escaped (htmlspecialchars()) as it is. Should turn URL-s automatically into links Should support some form of basic markups (bold, image, url, pre, list) Should have a simple parser, that turns user input te...

PHP: BBCode with SQL selection?

I would like to code a bbcode with SQL selection. Basically I want the user to be able to input [user]Anotheruser[/user] in a text field, which then is converted in the front-end to an URL that looks like this: http://mydomain.com/user/[userid]/anotheruser. So in order to get the userid, I'd need to include an SQL selection, and addition...

How to remove BBCode from a string in .Net

I'm trying to remove all BBCode Tags from a string. [url]www.google.com[/url] becomes www.google.com I have a regex that works in php to find them all, just dont know how to remove them in .net RegEx to Find BBCode |[[\/\!]*?[^\[\]]*?]|si ...

TinyMCE BBcode plugin breaks text format on paste

Hi all, I have a problem with the BBcode plugin of TinyMce. If i paste a normal text took from a site like this (i took it from lipsum.com): Code: "The standard Lorem Ipsum passage, used since the 1500s "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut eni...

PHP Fomatting Regex - BBCode

To be honest, I suck at regex so much, I would use RegexBuddy, but I'm working on my Mac and sometimes it doesn't help much (for me). Well, for what I need to do is a function in php function replaceTags($n) { $n = str_replace("[[", "<b>", $n); $n = str_replace("]]", "</b>", $n); } Although this is a bad example in case someo...

Regex & BBCode - Perfecting Nested Quote

Hey there, I'm working on some BBcode for my website. I've managed to get most of the codes working perfectly, however the [QUOTE] tag is giving me some grief. When I get something like this: [QUOTE=1] [QUOTE=2] This is a quote from someone else [/QUOTE] This is someone else quoting someone else [/QUOTE] It will return: > 1 said...

Parse vBulletin's BB Code in PHP

I would like a function that parses BB Code from vBulletin into a standard HTML markup. Without using the PEAR library or the PECL extension, because I don't want to fuss with PEAR or have to depend on being able to install a PECL extension on every instance of this application. The goal is zero dependencies. It would be fine if I could...

Colorize code inside <code></code>

I'm looking for a open source PHP script to colorize the code inside <code></code> or [code][/code] tags. Thanks ...

Regex BBCode to HTML

I writing BBcode converter to html. Converter should skip unclosed tags. I thought about 2 options to do it: 1) match all tags in once using one regex call, like: Regex re2 = new Regex(@"\[(\ /?(?:b|i|u|quote|strike))\]"); MatchCollection mc = re2.Matches(sourcestring); and then, loop over MatchCollection using 2 pointers to find s...

Searching a simple jQuery BB-code plugin

I'm searching for a jQuery plugin or function to insert bb code in a selected textarea - nothing more. I found plugins like http://markitup.jaysalvat.com/downloads/ but they add are to oversized for my project. All i want is the following function realised in jQuery: document.getElementById("bold_button").onclick = function() { form...

Looking for parsing patterns for a Silverlight bbcode-to-TextBlock/Run parser

I would like to create a simple parser class for Silverlight which parses this text: [size=15]This is the header[/size] This is [i]italicized text[/i] and this is [b]bolded text[/b] and this is a hyperlink: [url]http://example.org[/url] and so is this: [url=http://example.com]Example[/url]. into this kind of code: T...

PHP - BBCode parser - Parse both bbcode link tag and not tagged link

Hello to everyone. I need to do this : when a user insert a BBCode tag, with preg_replace and regex i do some trasformation. e.g. function forumBBCode($str){ $format_search=array( '#\[url=(.*?)\](.*?)\[/url\]#i' ); $format_replace=array( '<a class="lforum" target="_blank" href="$1">$2</a>' ); $str=preg_re...