in reply to Re: A Tagcloud For Cory Doctorow
in thread A Tagcloud For Cory Doctorow
...only works if you assume that '@'-signs are exclusively found in tags, not the body of the notes.# escape everything before @tags $this_line = HTML::Entities::encode("$1") . "$2" if /^([^@]*)(.*)/s;
I like the one-pass s///g for both building up %lines and linkifying tags. I used split and pop because everyone in the BoingBoing comments was saying "Use a regex! This is perfect for regexes!"
I loves me a good regex as much as the next monk, but there's a tendency to want to use them for everything once you grasp the power of 'em. I decided to use something simpler in the note parsing deliberately to counter that.
I still managed to have some regex fun in the search string highlighting code. :-)
|
|---|