monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

Weird behavior only when typing <span in HTML

Open YipYipX4 opened this issue 10 years ago • 2 comments

Steps to reproduce, using Chrome Version 50.0.2661.102 m (64-bit):

  1. Go to https://microsoft.github.io/monaco-editor/index.html
  2. Change language to HTML.
  3. Click at the end of and press Enter.
  4. Type "<span" and notice how it suddenly becomes "span <" (before even pressing space). If I backspace, it goes back to "<spa". If I type "<spandex", it will show as "spandex <". After pressing space or ">", the cursor jumps past the "<", but the problem remains. Similar behavior occurs when trying to type the closing tag "", so trying to type "" becomes "span span <> </>".

I was also able to reproduce this in IE11.

I am not able to reproduce this with any other tag. Typing "<div" or "<spin" or anything that doesn't start with "<span" does not cause the problematic behavior.

YipYipX4 avatar Jun 21 '16 21:06 YipYipX4

zajeta slika editor brokes in firefox.

nikikante avatar Jun 21 '16 22:06 nikikante

Nice find! This is a conflict with bootstrap that contains this rule:

[class*="span"] {
    float: left;
    min-height: 1px;
    margin-left: 30px;
}

and the html tokenizer generates the following class name:

<span class="token entity name tag tag-span">span</span>

alexdima avatar Jun 24 '16 10:06 alexdima