Questions tagged [bbcode]

Bulletin Board Code is a lightweight markup language used to format posts in many message boards. There is no "standard" set of BBCodes, but they are typically parsed into other markup languages.

BBCode or Bulletin Board Code is a lightweight markup language used to format posts in many message boards. The available tags are usually indicated by square brackets ([ ]) surrounding a keyword, and they are parsed by the message board system before being translated into markup languages such as HTML.

Unlike SGML-based markup languages, tags in BBCode do not have attributes. Instead, they may have a single parameter attached to them with the equals sign as a separator, such as the "color" tag on phpBB boards, where [color=red] would make red text, for example.

Common tags include:

  • [b] which makes bold text*
  • [i] which makes italic text*
  • [u] which makes underlined text*
  • [s] which makes strikethrough
  • [quote] which makes a block-level quote box of another post*
  • [color] which takes a color parameter and makes colored text*
  • [code] which creates a code block, inside which BBCodes are typically not parsed*
  • [img] which embeds an image inline*
  • [url] which creates a link to a specified location*
  • [spoiler] which creates a button to show/hide contained text
  • [background] which highlights text

* available by default in phpBB 3.0

611 questions
7
votes
3 answers

Using PEG Parser for BBCode Parsing: pegjs or ... what?

I have a bbcode -> html converter that responds to the change event in a textarea. Currently, this is done using a series of regular expressions, and there are a number of pathological cases. I've always wanted to sharpen the pencil on this grammar,…
Steve Ross
  • 4,134
  • 1
  • 28
  • 40
6
votes
3 answers

Avoid XSS with BBCode input and HTML output

I'm currently working on a website, where users can write articles with few format possibilities (like bold, italic, list...). I'm using a framework: CodeIgniter. I'm a beginner, and I've heard some stuff about XSS. I would like to know what do you…
user2500511
6
votes
1 answer

Custom tags in CKEditor BBCode plugin

I'm using CKEditor with BBCode plugin and I need to add custom tags like a spoiler tag and another one which would provide the possibility to link to a site user's profile. spoiler tags would work like blockquote tags: clicking the button and…
user1367567
  • 73
  • 1
  • 5
5
votes
0 answers

Any solution to convert HTML to BBcode

Possible Duplicate: How to convert HTML to BBCode Is there any php class or library to convert HTML to BB Code? I looked in Package Information: HTML_BBCodeParser, but this is doing vast vice versa.
Tom
  • 162
  • 2
  • 4
  • 11
5
votes
6 answers

BBCode parser without Regex?

I'm looking for a BBCode parser in Javascript or PHP without the need of using Regex. Can anybody suggest me a good one?
Teiv
  • 2,605
  • 10
  • 39
  • 48
5
votes
2 answers

Handling spoiler BBcode Android

I'm developing an application for a forum. I need to get a spoiler button like the Tapatalk's one that hides a text portion, that shows only when the user clicks on the button. I'm getting all the text of the post, including the spoiler BBCode.…
CallMeDeftsu4
  • 127
  • 1
  • 12
5
votes
2 answers

Integrating MarkItUp rich text editor preview with ASP.NET MVC app

I'm testing out the MarkItUp! rich text editor in a MVC app, and everything is working great with the exception of the preview. In the settings (set.js), there is a previewParserPath property ("path to your BBCode parser"). I'm not exactly sure…
RSolberg
  • 26,821
  • 23
  • 116
  • 160
4
votes
1 answer

Convert BBcode to HTML using JavaScript/jQuery

Could I please get some help with coverting some PHP code to jQuery/JavaScript? What I want is a simple BBCode to HTML converter. Here is the PHP code. I want to achieve the same thing using jQuery/JavaScript. $str = htmlentities($str); // The…
user1043994
4
votes
1 answer

TinyMCE and BBCode plugin

I am trying to implement tinyMCE's BBCode plugin but not being able to make it work. This is the init code: $(textarea).tinymce({ script_url : '/js/tiny_mce/tiny_mce.js', theme : "advanced", plugins : "bbcode", …
Gerardo
  • 1,928
  • 4
  • 24
  • 34
4
votes
1 answer

Need help converting bbcode URLs that contain spaces to valid markdown

As part of some data migration I'm converting user content from bbcode to markdown. I'm doing the conversion in a custom MySQL 8.0.22 function, which contains the following line to convert bbcode [url] tags to markdown: ... SET markdown =…
andrewzuku
  • 43
  • 4
4
votes
2 answers

How to match optional open/close tags in JavaCC?

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…
Kdeveloper
  • 13,679
  • 11
  • 41
  • 49
4
votes
5 answers

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…
Josh K
  • 28,364
  • 20
  • 86
  • 132
4
votes
1 answer

Replicating some of the functionality in SCEditor

In my current application I have created a custom BBCode editor - I use a number of BBCode extensions and have other integration requirements that make it imperative that I use my own editor rahter than an off-the-shelf one. Creating this,…
DroidOS
  • 8,530
  • 16
  • 99
  • 171
4
votes
2 answers

How do I make match stop on first occurance?

I need to digest some bbcode with a Ruby regular expression. I have to delimit the elements with the match command and use a regexp /pattern/m to get rid of newlines. For example, my bbcode in a string is: s="[b]Title[/b] \n Article text \n…
Konstantin
  • 2,983
  • 3
  • 33
  • 55
4
votes
3 answers

BBCode or wiki markup libraries for .NET?

What's your favourite library for .NET for handling either: BBCode markup Wiki markup Why do you use those libraries, what is so good about them and why should I use them?
user32826
1
2
3
40 41