Handle empty strings in getContentFragment()/getHtmlFragment() methods