Topic: WYSYWYG BBCode Editor

I'm making a WYSIWYG (what you see is what you get) mod for PunBB. Does anyone know of a good WYSIWYG BBCode editor? (Usually WYSIWYG editors edit HTML, but I want to edit BBCode.)

2

Re: WYSYWYG BBCode Editor

It is hard to make it if you want to compatble with all browser, BTW goto www.hotscripts.com www.phpclasses.org

If your people come crazy, you will not need to your mind any more.

Re: WYSYWYG BBCode Editor

you might be better starting with a html one, cutting out the stuff that can't be done with bbcode, then making a thing that converts it afterwards

Re: WYSYWYG BBCode Editor

That's what I thought of doing. I'd have to find a separate BBCode parser to convert it to/from HTML (say if someone wants to edit it).

Re: WYSYWYG BBCode Editor

well you don't need to to html... punbb does that already tongue

Re: WYSYWYG BBCode Editor

I want to use TinyMCE for the WYSIWYG part. It does HTML, which, oh, nevermind. parser.php can be edited to parse html tags. Maybe by next week, I could have my mod done, and be less of a PHP newbie. smile

Re: WYSYWYG BBCode Editor

parser.php doen't need to parse html, html is parsed by the browser wink unless you mean parse the post into bbcode

8 (edited by scottywz 2005-06-18 19:35)

Re: WYSYWYG BBCode Editor

Ok. I;m going to keep [ quote] and [ code] as BBCode tags, and probably make the parser parse the HTML into HTML. And, no, the <marquee> element will not be used. smile

Re: WYSYWYG BBCode Editor

I'm going to mod the parser to allow HTML in addition to BBCode. The WYSIWYG Editor (preferably released under the LGPL) will have buttons for only certain elements (namely those that BBCodes translate to). If someone tries to use a bad element in the source code, it won't work.

10

Re: WYSYWYG BBCode Editor

It rocks & is a perfect fit for Pun! wink http://www.themaninblue.com/experiment/widgEditor/

I had thought about HTML to BBcoding it, found Rickard's BBcode mod first though.
A few input button styles & Voila! smile

cheers

Re: WYSYWYG BBCode Editor

scotty what do you plan to do to stop "nasty" html?

12

Re: WYSYWYG BBCode Editor

Connorhd wrote:

scotty what do you plan to do to stop "nasty" html?

Widg does a nice job w/the nasties wink

13 (edited by scottywz 2005-06-27 18:18)

Re: WYSYWYG BBCode Editor

By nasty HTML, do you mean JavaScript installing spyware? Well, in that case, I will have the parser modded to only allow certain "good" HTML.

Example:

<strong> </strong> / <b> </b>
<em> </em> / <i> </i>
<u> </u>
<a href="http:// "> </a> / <a href="https:// "> </a> / <a href="ftp:// "> </a> / <a href="mailto: "> </a> / <a href="irc:// "> </a>
<img src=" " alt=" " /> / <img src=" " alt=" "> / <img alt=" " src=" " /> / <img alt=" " src=" ">
<del> </del> / <strike> </strike>
<table> </table>
<caption> </caption> (converts to <div align="center"> </div>)
<tr> </tr>
<th> </th>
<td> </td>
<ul> </ul>
<ol> </ol>
<li> </li>
<div style=" "> </div>
<div align=" "> </div>
<div align=" " style=" "> </div> / <div style=" " alt=" ">
<h> </h> (converts to <div style="background-color: #FFFF00; color: #000000"> </div>)

and maybe other reasonable HTMLs.

Notes:

1.  Only certain ATTRIBUTES are allowed as well (to thwart the use of onClick, onMouseOver, or basically on* and any other disallowed attributes).

2.

Well, what if someone wants a hyperlink that, when clicked, displays a JavaScript dialog?

Well, I'll consider that.

14

Re: WYSYWYG BBCode Editor

I meant nasties as in NON-valid markup, like <div align="center">, font tag soup etc.

.js exploits too though smile

Widg did a great job keeping things valid, in the limited tests I've done...

cheers

Re: WYSYWYG BBCode Editor

what if someone does
<div style="position:absolute; top: 0px; left: 0px; width: 10000px; height: 10000px; background-color:red">Whoops</div>

16

Re: WYSYWYG BBCode Editor

Connorhd,
have you looked at Widg?

Am curious what some others think? I was impressed with the minimalist design & its performance.

P.S. it uses a really cool way to do image button rollovers w/css too. (editor buttons) check it out!

cheers

Re: WYSYWYG BBCode Editor

yeh i looked at it, however it doesn't do very much (i guess you could extend it) but it looks like a bit of a waste of time to me, it doesn't do enough to make it worth while

18

Re: WYSYWYG BBCode Editor

thats what I liked about it smile

Re: WYSYWYG BBCode Editor

GregK wrote:

I meant nasties as in NON-valid markup, like <div align="center">, font tag soup etc.

.js exploits too though smile

Widg did a great job keeping things valid, in the limited tests I've done...

cheers

<div align=center> is invalid? hmm

20

Re: WYSYWYG BBCode Editor

AFAIK it is?

I'd use...

<div style="text-align:center;"></div>

Re: WYSYWYG BBCode Editor

And, what does AFAIK mean?

Re: WYSYWYG BBCode Editor

as far as i know and hes right

The "align" attribute of the div element was deprecated in HTML 4.01.

The "align" attribute of the div element is not supported in XHTML 1.0 Strict DTD.

also like i asked before what if someone does

<div style="position:absolute; top: 0px; left: 0px; width: 10000px; height: 10000px; background-color:red">Whoops</div>

Re: WYSYWYG BBCode Editor

It makes a big red page 10000 px wide and 10000 px high with the word "Whoops" on it. At least that's how it is in Firefox.

Re: WYSYWYG BBCode Editor

well, i don't really want people to be able to do that tongue

25

Re: WYSYWYG BBCode Editor

lol

allowing html on a forum, is just askin' for it big_smile