Downtime » HTML

QuickTag

A parser that makes HTML slightly quicker to write

This is a very simple parser for a modified HTML

The idea was to bring HTML class and id attributes inline with CSS and jQuery selectors, so instead of:

<div class=”class-one class-two” id=”my-id”

You can use:

<div#my-id.class-one.class-two

It’s not a huge difference, but its something that’s always bothered me, and it only took half an hour to write the parser, so I thought I’d share it.

Implementation is up to you as the getHTML() method just returns the HTML code as a string variable, ideally this should be built into a caching labrary to avoid unnecessary processing.

See the GitHub Page for usage example and source code.