bug fix: can now handle documents starting with <!DOCTYPE html>