JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 20th, 2013, 04:00 AM
doush. doush. is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 119 doush. User rank is Private First Class (20 - 50 Reputation Level)doush. User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 6 h 2 m 7 sec
Reputation Power: 8
WYSIWYG - contenteditable clean the output

Hi guys,

I've just been adding a really simple WYSIWYG editor and I've come across a problem with consistent output between browsers.

When I view the source there seems to be weird markup in there and some use different elements. For example when pressing return. Some browsers add <br> tags, others wrap in p and some in divs.

I was wondering what is the best way to filter this in javascript. I am submitting this content to a database to display on the front end so I want to make sure its clean and consistent.

Thanks

Reply With Quote
  #2  
Old February 20th, 2013, 04:39 AM
Jacques1's Avatar
Jacques1 Jacques1 is offline
pollyanna
Click here for more information.
 
Join Date: Jul 2012
Location: Germany
Posts: 1,864 Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level)Jacques1 User rank is Lieutenant General (80000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 1 Day 21 h 20 m 24 sec
Reputation Power: 813
Hi,

is there any reason why you need to make your own editor? I mean, there are literally hundreds of them out there in every flavor. And as far as I can tell, they've solved this problem already.

Reply With Quote
  #3  
Old February 20th, 2013, 04:49 AM
doush. doush. is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 119 doush. User rank is Private First Class (20 - 50 Reputation Level)doush. User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Day 6 h 2 m 7 sec
Reputation Power: 8
Quote:
Originally Posted by Jacques1
Hi,

is there any reason why you need to make your own editor? I mean, there are literally hundreds of them out there in every flavor. And as far as I can tell, they've solved this problem already.


Yeah I was thinking I was going to get this response. To be honest I just don't want to included other things because they tend to have bloat. Things I would never use that I would need to spend time to strip them out.

Reply With Quote
  #4  
Old February 28th, 2013, 11:56 AM
wmwong wmwong is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2013
Posts: 1 wmwong User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 26 m 36 sec
Reputation Power: 0
What basic functionality do you actually need? Most editors allow you to modify their toolbar pretty easily. If you're thinking about building your own editor, take a look at the blog post below about contenteditable and why you probably don't want to take this approach. The basic premise is that building your own editor is easy, but building one that works well is really, really, really hard.

snapeditor.com/blog/posts/see-how-easily-you-can-make-web-content-editable

(Sorry, I can't post URLs yet)

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > WYSIWYG - contenteditable clean the output

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap