monaco-editor
monaco-editor copied to clipboard
Weird behavior only when typing <span in HTML
Steps to reproduce, using Chrome Version 50.0.2661.102 m (64-bit):
- Go to https://microsoft.github.io/monaco-editor/index.html
- Change language to HTML.
- Click at the end of and press Enter.
- 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.
editor brokes in firefox.
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>