I have taken this example off the emmet.io demo video, if I type the text and choose "Expand Abbreviation at Cursor" (shift + enter) it gives the following error, however if I choose "Expand Abbreviation" (ctrl + ,) and type the text in there, it works fine. It seems to be an issue when there is a space between the curly braces, if I remove the space and choose "Expand Abbreviation at Cursor" (shift + enter), then it works.
ul#nav>li.item$*4>a{Item $}
FIXED: Bug with Emmet - v10.90b2
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: Bug with Emmet - v10.90b2
Extracting abbreviations at cursor position is not simple, but it should work now. It handles (...), [...], {...} properly now and use regex to distinguish between > in abbreviations and > in legal tags.
-
- Posts: 350
- Joined: 06 Jun 2012 11:08
Re: FIXED: Bug with Emmet - v10.90b2
There is still a bug with these functions, if I use the example string "html>head+body", if I type the text and choose "Expand Abbreviation at Cursor" (shift + enter) it appears incorrectly [screenshot attached], however it works fine when using "Expand Abbreviation" (ctrl + ,)
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: FIXED: Bug with Emmet - v10.90b2
This code is taken from the Emmet source code
Adding a + to the specialChars string solves the issue (specialChars := '#.*:$-_!@|%+').
Looking at the code - do you see any other characters that should be allowed in an abbreviation?
Code: Select all
function isAllowedChar(ach: Char): Boolean;
var
charCode: Integer;
specialChars: string;
begin
specialChars := '#.*:$-_!@|%';
charCode := Integer(ach);
Result := ((charCode > 64) and (charCode < 91)) or // uppercase letter
((charCode > 96) and (charCode < 123)) or // lowercase letter
((charCode > 47) and (charCode < 58) ) or // number
(Pos(ach,specialChars) > 0); // special character
end;
Looking at the code - do you see any other characters that should be allowed in an abbreviation?
- Rickard Johansson
- Site Admin
- Posts: 6783
- Joined: 19 Jul 2006 14:29
Re: FIXED: Bug with Emmet - v10.90b2
And I should probably mention that braces like (),[] and {} are already allowed, but tested separately.
-
- Posts: 350
- Joined: 06 Jun 2012 11:08
Re: FIXED: Bug with Emmet - v10.90b2
This seems to be broken again in v10.90 final.