tools: fix bug in doc-extract, handle spaces in summary line