WEB-12316 PhpStorm performing awful when typing in HTML zones in PHP files

Reimplement calculation of emmet abbreviation.
See original implementation: https://github.com/emmetio/emmet/blob/master/lib/utils/action.js