hello, i'm making my own bbcode parser, and i've a problem when i try to do the recursive quote.
this is my code :
function forumBBCode($str){
$format_search=array(
'#\[quote=(.*?)\](.*?)\[/quote\]#is'
);
$format_replace=array(
'<blockquote class="quotearea"><i><a class="lblackbu" href="./index.php?status=userview&userv=$1">$1</a> wr...
The following code outputs:
http://www.google.com
http://www.google.com&lang
What is the simplest way to change the code so it outputs:
http://www.google.com
http://www.google.com&lang=en&param2=this&param3=that
CODE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace...
I've googled some code that converts an url into a hyperlink using bbcode The code is :
// format the url tags: [url=www.website.com]my site[/url]
// becomes: <a href="www.website.com">my site</a>
exp = new Regex(@"\[url\=([^\]]+)\]([^\]]+)\[/url\]");
str = exp.Replace(str, "<a href=\"$1\">$2</a>");
// format the img tags: [img]www.web...
Hi,
I have this function to parse bbcode -> html:
$this->text = preg_replace(array(
'/\[b\](.*?)\[\/b\]/ms',
'/\[i\](.*?)\[\/i\]/ms',
'/\[u\](.*?)\[\/u\]/ms',
'/\[img\](.*?)\[\/img\]/ms',
'/\[email\](.*?)\[\/email\]/ms',
'/\[url\="?(.*?)"?\](.*?)\[\/url\]/ms',
'/\[size\="?(.*?)"?\](.*?)\[\/size\]/ms',
...
Hi, I just installed Invision Power Board Version 3.1.1 script on a server and I need to add a button on the text editor so that it shows a message box, takes an input, formats it and inserts it in the comment. Much like the image link button. Anyone with IPB experience please comment :) Thanks.
...
Hi I recently discovered an issue where people using BB Code to enter links are able to manipulate them.
They are meant to enter something like:
[LINK]http://www.domain.com[/LINK]
However they can enter something like this to make the link color red:
[LINK]http://www.domain.com 'span style="color:red;"'[/LINK]
This is the code...
I recently discovered an issue where people using BB Code to enter links are able to manipulate them.
They are meant to enter something like:
[LINK=http://www.domain.com]example text[/LINK]
However they can enter something like this to make the link color red:
[LINK=http://www.domain.com 'span style="color:red;"']example text[/L...
Sigh, regex trouble again.
I have following in $text:
[img]http://www.site.com/logo.jpg[/img]
and
[url]http://www.site.com[/url]
I have regex expression:
$text = preg_replace("/(?<!(\[img\]|\[url\]))([http|ftp]+:\/\/)?\S+[^\s.,>)\];'\"!?]\.+[com|ru|net|ua|biz|org]+\/?[^<>\n\r ]+[A-Za-z0-9](?!(\[\/img\]|\[\/url\]))/","there was l...
Hello,
I'm trying to remove nested quoting from my bulletin board, but I'm having some issues.
Example input:
[quote author=personX link=topic=12.msg1910#msg1910 date=1282745641]
[quote author=PersonY link=topic=12.msg1795#msg1795 date=1282727068]
The message in the original quote
[/quote]
A second message quoting the firs...
Hey there. I am currently creating bbcode parsing engine and I have encountered a situation what i can't figure out on my own.
The thing is, that I popped into a problem exactly like this one:
http://stackoverflow.com/questions/3457039/apache-php-on-windows-crashes-with-regular-expression
That means that if i make something like the ex...
I want cut out everything inside (tags included) from text, for ex:
[url=http://xxx.com]something[/url]
but with one condition, inside of [url] tag there would be [img] tag.
So final sentence to cut:
[url=http://xxx.com]anything[img]something[/url]
can anyone help? im bad with regular expressions, or there is easier way?
...
I want to use markItUp to allow users to format their text using bbcode, but the preview isn't working.
I've downloaded markItUp 1.1.8 from the site and tested this locally. The default behaviour is to use HTML code for formatting, and pressing preview renders the code as html and displays the formatting.
I've downloaded the "basic b...
Heya!
I've managed to successfuly integrate BBCode, but I was wondering say if I wanted to dynamically list all the allowed/accepted BBCode - how would I be able to do that? (as it can be tedious manually writing out...and if the BBCode ever changed I'd have to update the writing)
I current have a BBCode() function, which contains 2 ar...
str = "some html code [img]......[/img] some html code [img]......[/img]"
I want use regex get the array:
["[img]......[/img]","[img]......[/img]"]
Any ideas anyone?
...
I'm working on a JavaCC parser that should parse BBcodes.
My Javacc source code: patebin.com (Junit test: here)
The source code kind off works, but it does not want to accept tokens with a single character, only multi character strings are recognized.
It does parse this string:
"test[b]bold[/b]nothing[b]bold[/b]after"
But not:
"t[b...
What JavaCC syntax does implement grammar that can parse these kind of lines:
[b]content[/b]
content[/b]
[b]content
Although the JavaCC parser needs to parse all lines, it must distinguish correct and incorrect tagging behavior.
Correct tags are like the 1st line, they have an open and close tag. When the tags are matched this will o...
Alright so I am using a little bbcode function for a forum I have, working well, so if, in example, I put
[b]Text[/b]
it will print Text in bold.
My issue is, if I have that code:
[b]
Text[/b]
Well it will not work, and just print that as it's right now.
Here is an example of the function I am using:
function BBCode ($string) {
...
When using PHP's BBCode extension, does anyone know what BBCODE_TYPE_ROOT means exactly? It doesn't seem necessary, at least with this example, however, it is used in most of the examples in the documentation.
The documentation is pretty vague about this element:
BBCODE_TYPE_ROOT (integer)
This BBCode tag is the special tag root (n...
Our clients are able to edit some text on our "admin" web site, which then displays to their customers on another "client" web site. They now want the ability to add mark-up like bold, italic, underline (and combinations of the above) plus links to web pages. Unfortunately, because we use a web framework that passes the stored text thr...
This is a collection of markup language comparison, which may cover the below points, please don't close this question.
easy to write.
easy to read.
integration for program languages.
convert tools for html/pdf
other staffs.
...