Punct!

21st March, 2006 @ 7:25am GMT

Development, JavaScript, Typography, Web, Web Standards, XHTML / 2 Comments

Most web developers have, at some point, experienced the pain of browsing through client-written content to change symbols into meaningful HTML entities. Of course, a lot of the time, we’re even using the wrong entities!

Well, now it’s a little easier with the help of “Punct!,” a client-side script I have created for two reasons; as an experiment in JSON and to save time when cutting and pasting code from Word documents into web sites.

Punct basically takes any content pasted or typed into it and converts characters such as em-dashes, quotes and horizontal ellipses into their relevant best HTML entities. You can also specify whether to include paragraph tags which helps anyone pasting content into Wordpress (like this very article).To have a go, click the link below:

Punct, a web-based content aid…

Incidentally, this is only version 1.3 — it’s not perfect, it’s not my final word on the matter (it’s the beginning of something far bigger), it jams the content preview into the page using innerHTML (a nasty method) and it’s only available with Javascript turned on since I wanted to utilise client-side processing power. I’m only really launching it here since several of my fellow developers at Rentokil seem quite keen on using it. Watch this space for further developments!

Like this post? Digg it, Del.icio.us it, Ma.gnolia it!

Comments (2)

Skip to the comment form…

  1. Gravatar Image Matthew Pennell March 21, 2006 @ 10:22 am

    You have a bug if you put a space at the end of a line - it misses out the closing paragraph tag. It’s also possible to type in the bottom textarea (although obviously it is then overwritten).

    Apart from that, looks useful. :)

  2. Gravatar Image Tim March 21, 2006 @ 10:32 am

    @Matt:

    Actually, that’s not a bug - although it may appear to be so. Placing a space at the end of a line is, effectively, bad punctuation and since we depend on good punctuation to define which symbol to convert to, it screws everything up.

    Am looking at improving conversion with bad punctuation though!

Leave a comment





Categories

Syndication

Technorati

© 2008 Tim Huegdon, All Rights Reserved / Website design and development by Nefarious Designs

Powered by Wordpress 2.3 / Login

Due to the dodgy manufacturing process, this website may contain traces of nuts!