I needed a basic tool that could clean up some text that was created in Microsoft Publisher and Microsoft Word. I needed to get rid of the special characters, and remove the line breaks from the narrow column layout created in Publisher. I found a couple tools online, but I also found a few other functions that I thought would be useful and added them all together in one package.

Note: After I finished this text tool, I found another tool that is more advanced. I decided to upload everything I've worked on anyway and share the source code...

I am by no means a javascript programmer, so most of the javascript was written by others. I have included the original creators of the code snippets in comments and in the credits. When I modified the code, I also noted that in the comments. If anyone gets any use out of this tool, and can improve or add more useful functions, it would be great if you could email me what you have added or modified.

Below is a list of the basic functions I have put together. I also created a file that lists the source code for each function, for those who want a single function and do not want to take the time to go through all the source code. I have learned a lot from others on the Internet, so I thought maybe I could contribute something that may help someone else.

Basic Text Cleaner Functions:

Menu:

  1. Select All - Selects all text (no auto copy)
  2. Delete All - Deletes all text

Remove:

  1. Line Breaks - Removes all line breaks, excess white space and tab spaces
  2. HTML Tags - Removes all HTML tags
  3. Excess White Space - Removes all excess white space, preserving single spaces and line breaks
  4. Tab Spaces - Removes all tab spaces

Convert:

  1. To Lowercase - Converts all text to lowercase
  2. Special Characters - Converts a select list of special characters from Word documents
  3. Preserve HTML - When checked, clicking Special Characters link/button will convert special characters to HTML entities
Special Characters
“
”
‘
’
–
—
© ©
® ®
™