fix https://github.com/daviferreira/medium-editor/issues/218
Verifies if seletedParentElement.tagName is not undefined