Search code examples
c#javascriptjquerybbcodemarkitup

markitup editor display output as html, and strip tags


im using this rte in bbcode format.

http://markitup.jaysalvat.com/home/

once the textarea is submitted i'm saving it with bbcode format.

but i need 2 things.

  • how do i now display it as html?
  • how can i display without the bbcode tags (i.e just text)

Solution

  • Convert in javascript,

    Convert in c#,

    Convert in PHP...

    There are a lot of ways to convert BBCode. If you want to get rid of the BBCode, you'll have to use a regular expression removing all the [ ] blocks. Something like this'll do:

    return preg_replace('|[[\/\!]*?[^\[\]]*?]|si','', $yourblockofbbcode);
    

    (source)