journal
all ![]() | Rob is 20,118 days old today. |
Entries this day: Dream_TJ_Bike Passed_XHTML-Strict Passing_XHTML-Strict Dream TJ Bike 8:33am JST Friday 14 September 2007 (day 13687) TJ Bike had a flat tire. I was riding and felt the back a little squishy, and then when I looked down later, it was 1/4 full. permalinkPassed XHTML Strict 3:48pm JST Friday 14 September 2007 (day 13687) Cool. I just got this day to pass the requirements for XHTML Strict. Other days don't pass yet, but I'm going to make an attempt to make most of them pass in just a bit. permalinkPassing XHTML Strict 6:29pm JST Friday 14 September 2007 (day 13687) Cool. It took me a bit, but I figured out a way to replace instances of <! ... > with <!-- ... > in my journal entries. I thought about perl first, then thought the code has probably been written already, but the tools I found (HTML Tidy, et. al.) were all way too difficult for what I wanted to do. It's just a simple search and replace, and then I realized either awk or sed is perfectly suited for that. Turns out it's sed. My resulting code: for fl in `find . -name "*.html"`; do sed -i 's/<!\([^-]\)\([^>]*\)/<!-- \1\2 --/' $fl done The first part of the match may be more difficult than needed, but I wanted it to not flub up files if I ran it twice, nor if they were already in correct format. 6:36pm JST Hahahaha at first I had put the sed code up there without htmlifying the < and > chars. Suddenly the page was no longer XHTML Strict!! hahahaahahah Headed home now. Actually going to meet Ami in Shibuya. permalink |