Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in IE11 when applying formatters #631

Closed
jcubic opened this issue Nov 18, 2020 · 0 comments
Closed

Exception in IE11 when applying formatters #631

jcubic opened this issue Nov 18, 2020 · 0 comments
Labels
Bug resolved if issue is resolved, it will be open until merge with master

Comments

@jcubic
Copy link
Owner

jcubic commented Nov 18, 2020

Issue summary

There is exception in IE11 while trying to apply formatters

Steps to reproduce

  1. Open demo in IE11
  2. Press enter few times

The issue came from this function:

    function count_selfclosing_formatting(e) {
        var n = 0;
        if ($.terminal.have_formatting(e)) {
            var r = new RegExp(format_parts_re,"i");
            $.terminal.format_split(e).forEach(function(e) {
                if ($.terminal.is_formatting(e)) {
                    var t = e.match(r);
                    if (t && t[1].match(/@/) && t[6] === "") {
                        n++
                    }
                }
            })
        }
        return n
    }

format_parts_re is regex that it's used to create new regex without g flag, the code should use format_parts_re.source that is supported in IE11.

Browser and OS

Windows 10, IE11

@jcubic jcubic added the Bug label Nov 18, 2020
@jcubic jcubic changed the title Exepation in IE11 when applying formatters Exception in IE11 when applying formatters Nov 18, 2020
jcubic added a commit that referenced this issue Nov 19, 2020
Exception happen because in IE you can create Regular using constructor
from other regex, any other browsers seems to be fine with that
@jcubic jcubic added the resolved if issue is resolved, it will be open until merge with master label Nov 19, 2020
@jcubic jcubic closed this as completed Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug resolved if issue is resolved, it will be open until merge with master
Projects
None yet
Development

No branches or pull requests

1 participant