Ignoring case and using raw HTML if no text or inputs