Pascal Emmet
Re: Pascal Emmet
Users need to get Lorem text even w/o any HTML, for ex in Markdown files, how to do it? @lorem don't work- it gives 2 tags.
-
- Posts: 220
- Joined: 22 Sep 2017 07:59
Re: Pascal Emmet
Just noticed this thread.
Wow, you published / open sourced some of your code Rickard! That's sensational. Cannot be over-rated. I know there's a lot of open source code out there but you have made a step from closed to open and that is no doubt a great benefit for others and I find that a very promising and much appreciated effort ... even though I do not at presently code in Delphi / Pascal
!! Never the less it's so great that other Pascal devs can benefit from your classy work!
Great stuff
Wow, you published / open sourced some of your code Rickard! That's sensational. Cannot be over-rated. I know there's a lot of open source code out there but you have made a step from closed to open and that is no doubt a great benefit for others and I find that a very promising and much appreciated effort ... even though I do not at presently code in Delphi / Pascal

Great stuff

Last edited by inspector71 on 20 Mar 2020 02:46, edited 1 time in total.
Re: Pascal Emmet
Please move
cMultiplicationMax = 1000;
into options record, as field, so user can change it to e.g. 1500 when need to generate very long result.
cMultiplicationMax = 1000;
into options record, as field, so user can change it to e.g. 1500 when need to generate very long result.
Re: Pascal Emmet
Code: Select all
i := Pos('id=',s);
i := Pos('class=',s);
- Rickard Johansson
- Site Admin
- Posts: 6396
- Joined: 19 Jul 2006 14:29
Re: Pascal Emmet
Updated the Pascal Emmet files to version 1.13.
Added Markdown support (including lorem generated text @l or @l200).
Added a TEmmet property to set the multiplication limit. Default is still cMultiplicationMax = 1000.
Added Markdown support (including lorem generated text @l or @l200).
Added a TEmmet property to set the multiplication limit. Default is still cMultiplicationMax = 1000.
- Rickard Johansson
- Site Admin
- Posts: 6396
- Joined: 19 Jul 2006 14:29
Re: Pascal Emmet
Shouldn't be a problem. All tags in the snippets file are in lowercase. Abbreviations including .class should also be entered in lowercase.i := Pos('id=',s);
i := Pos('class=',s);
Re: Pascal Emmet
Updated wiki at https://wiki.freepascal.org/Emmet-Pascal
Thanks.
Thanks.
Re: Pascal Emmet
I have problem with UNSUPPORTED tags. for ex, "bs4bp". my editor allows expanding of this snippet via its own plugin, and editor calls Emmet too. if "my plugin" is not installed, editor calls Emmet, Emmet gives something for "bs4bp" - 2 tags. not good. users don't need result when "my plugin for bs4bp" is absent.
can we NOT expand unknown tags in Emmet, plz? by option or always?
can we NOT expand unknown tags in Emmet, plz? by option or always?
- Rickard Johansson
- Site Admin
- Posts: 6396
- Joined: 19 Jul 2006 14:29
Re: Pascal Emmet
Updated Emmet code to version 1.14.
The following was fixed:
* Fixed ${1:tabstop} index issue
* Fixed a class issue with span tag
The following was fixed:
* Fixed ${1:tabstop} index issue
* Fixed a class issue with span tag
Re: Pascal Emmet
thanks. can we have option
cMultiplicationMax = 1000;
in the options "record", not as "const", please?
Edit. you already did it.
cMultiplicationMax = 1000;
in the options "record", not as "const", please?
Edit. you already did it.
Re: Pascal Emmet
RJ, can you please see report at viewtopic.php?p=17013#p17013 ?
- Rickard Johansson
- Site Admin
- Posts: 6396
- Joined: 19 Jul 2006 14:29
Re: Pascal Emmet
It's not that simple. Not all HTML tags are added as abbreviations in the snippets file and XML tags are impossible to add, since they can be anything.
HTML
You may want this to work: p.myclass => <p class="myclass"></p> . But p is not added as an abbreviation, so with an option to only expand known tags - this wont work.
XML
In XML you can type something like this: developer#rickard{@lorem} => <developer id="rickard"> ... </developer>. This, of course, wont work either.
Maybe you could use a dedicated shortcut to expand Emmet abbreviations. And something else for other tasks?
HTML
You may want this to work: p.myclass => <p class="myclass"></p> . But p is not added as an abbreviation, so with an option to only expand known tags - this wont work.
XML
In XML you can type something like this: developer#rickard{@lorem} => <developer id="rickard"> ... </developer>. This, of course, wont work either.
Maybe you could use a dedicated shortcut to expand Emmet abbreviations. And something else for other tasks?
- Rickard Johansson
- Site Admin
- Posts: 6396
- Joined: 19 Jul 2006 14:29
Re: Pascal Emmet
Updated to version 1.15.
Version 1.15
* Added option to replace cursor positions | with indexed tab positions ${x}
Version 1.15
* Added option to replace cursor positions | with indexed tab positions ${x}
Re: Pascal Emmet
FPC 3.0.4 compile error
emmet.pas
function TEmmet.ExpandAbbreviation(AString: string; const ASyntax, ASelText:
string; out ASection: string; out bMultiCursorTabs: Boolean): string;
..
opt.AlwaysReturnIndexedTabs := False;
while record has another member
emmet.pas
function TEmmet.ExpandAbbreviation(AString: string; const ASyntax, ASelText:
string; out ASection: string; out bMultiCursorTabs: Boolean): string;
..
opt.AlwaysReturnIndexedTabs := False;
while record has another member
Code: Select all
TExpandOptions = record
AddSlashToEmptyTags: Boolean; // Add a slash to empty tags e.g. <img src="" />
AlwaysAddNewLine: Boolean; // Always add linefeed after each tag (usually used in XML)
AlwaysReturnIndexedTabStops: Boolean; // Convert all cursor positions | to indexed tab positions ${x} (HMTL,XML)
- Rickard Johansson
- Site Admin
- Posts: 6396
- Joined: 19 Jul 2006 14:29
Re: Pascal Emmet
I've updated the archive file and should now contain the correct version.