Turn two nested if into one.
Turn two nested if into one.

marclaporte/WeasyPrint,Kozea/WeasyPrint,marclaporte/WeasyPrint,Kozea/WeasyPrint,jasco/WeasyPrint,jasco/WeasyPrint,andrewleech/WeasyPrint,prepare/TestWeasyPrint,andrewleech/WeasyPrint,prepare/TestWeasyPrint