• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

HTML to BBcode

mrb1972

Active member
#1
Does any one know of a php script which would take a text string and convert and HTML code to BBcode, I have goggled but could'nt find anything
 

EQnoble

Well-known member
#6
If you are talking about a script that creates a custom bbcode that can be imported into any software that is probably never going to happen in my lifetime.

If your talking about a script to convert recognized strings into bbcodes with replacement text you are going to be hard put to find something "out there".

What exactly are you trying to do? Make a custom bbcode?..if so to do what. If you give a little more information I may be able to help you. Then again I may not...but I can't try if you don't help me help you :)
 

mrb1972

Active member
#7
If you are talking about a script that creates a custom bbcode that can be imported into any software that is probably never going to happen in my lifetime.

If your talking about a script to convert recognized strings into bbcodes with replacement text you are going to be hard put to find something "out there".

What exactly are you trying to do? Make a custom bbcode?..if so to do what. If you give a little more information I may be able to help you. Then again I may not...but I can't try if you don't help me help you :)
I was just converting a few html pages to posts and wanted to convert formatting like <strong> to bbcode, I was just being lazy and trying to find an automatic process... - I ended up making the changes manually
 

Brogan

XenForo moderator
Staff member
#8
A simple copy and paste into the editor would have sufficed.

Source formatting is retained for the most part.
 

Jeremy P

Well-known member
#9
Maybe too late now, but XenForo_Html_Renderer_BbCode::renderFromHtml(); is a static PHP method that does what you want. I use it in a custom addon to import news from HTML sources.