Text Editing tools, like the ones in devnetwork

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
arpowers
Forum Commoner
Posts: 76
Joined: Sun Oct 14, 2007 10:05 pm
Location: san diego, ca

Text Editing tools, like the ones in devnetwork

Post by arpowers »

Hey guys,

I'm just wondering how text editing tools like the ones here on DevNetwork are processed? (I'm talking about the 'code' 'quote' etc.. tags..)

I am building a wikipedia like feature and I think the Devnetwork implementation is really nice..

initially, im guessing its a string matching function for the tag?

any enlightenment would be great.. thanks!
Andrew
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Yes, it's basically a large string matching and massaging functionality.

Take a look around for bbcode and wikicode (or variants thereof) parsers. There are many out there; a bunch have been posted about here.. including by yours-truly.
User avatar
arpowers
Forum Commoner
Posts: 76
Joined: Sun Oct 14, 2007 10:05 pm
Location: san diego, ca

Post by arpowers »

is there any reason to use a wikipedia type parser over the bb?

The wikipedia markup is ugly and hard to understand at first glance...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Both have their share of merits and problems. Depending on how complex you want to go, they can equally get quite hairy. Typical parsers against each other, wiki-style ones will often be more simple and create cleaner resultant HTML. But mileage will vary.
Post Reply