I have been trying to insert some javascript buttons into the Posts widget of the new Blogger engine. There are no predefined widgets provided by Blogger for this purpose, so, I opened the template's HTML to insert it. However, the task that I thought gonna be easy became a frustrating task because the engine requires strict XHTML coding in the template thus making everything a nightmare to pass the syntax checker.
Struggling to insert the code, I discovered that the engine will parse any < and > entries into < and > of the generated code. So , I fire up gedit, paste the code, and do a search and replace for & < and >, replacing them with & < > and pasted the new code into the template. The result is -> Success!! -> look at the stumbleupon button below :)
Linux and BSD users can do this quickly on a text file by using sed.
cat file|sed s/'\&'/'\&'/g|sed s/'<'/'\<'/g|sed s/'>'/'\>'/g











1 comments:
6:15 PM
Ya, sed it a good handy tool, I even use it to modify huge sql dump file last time when I upgrade LBE post's style.
You can edit the file in place, if you are really sure. And it is more clean than using cat.
Check out this,
http://lne.blogdns.com/lbe/archives/129/search-and-replace/
Post a Comment