Refactor check_nokogiri in msftidy
Land todb-r7#8, better nested if