It suddenly occurred to me that the trouble may not be with the all static blog generators that I have been trying out but with the word press exporters. So far I had been using Wordpress to Jekyll exporter but because pelican had trouble with it, I used pelican's own importer. The pelican importer works with the wordpress xml file where as the former is a WP plugin. The importer didn't work out too well either but that started me looking for wordpress to markdown convertors and exitwp was one of the first that I ran across.
exitwp takes the wordpress xml as input and produces a collection of files as output. If you choose markdown as the format the file extension becomes .markdown which is not to Pelican's taste. However using the little known
rename command you can change the suffix quite easily.
rename 's/.markdown/.md/' *markdown
Having done so the generated HTML shows up correctly without any visible garbage. However I still have to open the pandora's box labelled templates. OTH, it might be a good idea to use the output from exitwp on other static blog generators and see what the result is like