[feature/editor-code-tabs] Correctly calculate end tag location

PHPBB3-11557