#!/usr/bin/ruby -Ku title = ARGF.gets.tr("\"\'<>&", "``[]$").chomp print < #{title}

#{title}

HDR def flush return if $hold.empty? puts "

#{$hold.join.chomp}

" $hold = [] end $hold = [] for line in ARGF line.tr!("\"\'<>&", "``[]$") case line when /^ / then $hold.push line else flush $hold.push line end end flush print < FTR