enhanced link detection, discarding empty pages

enhanced link detection, discarding empty pages