SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Clean Word HTML

  1. #1
    SitePoint Guru
    Join Date
    Jun 2004
    Location
    UK
    Posts
    605
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Clean Word HTML

    Hi,

    I have a 'textarea' javascript component which allows users to edit text in an HTML form's text area with some WYSIWYG features (such as emboldening, insertion of lists etc). However, this doesn't deal very well at all with text copied and pasted from Word.

    Is there a way (a VBScript function maybe) which can strip out Word HTML upon submitting the form, or alternatively a good free text-area replacement tool with this built-in?

    Thanks...

  2. #2
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to read up on Windows "smart quotes" and other such nasty MS-specific bits of encoding. Then you can write your own find and replace function for them using Replace()...

    I've seen good PHP examples before that could be converted. In fact, if you search these forums for "smart quotes" you'll find plenty of posts on the matter.

    FYI though, it seems the best approach is to make sure everything is encoded in Unicode (UTF-8) to avoid charset issues (which is what this is).

    Cheers,

    G


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •