Pascal Emmet

I'll try to publish some code I use in my program.
Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

It helped, 3-4 issues fixed. Thanks.

a) FPC warnings:
var "ws" not used.
in ExpandTagAbbrev, var "s" not inited.

b) I added to Github the Delphi demo. Delphi 10.3. in it, I still see these issues:
https://github.com/Alexey-T/Emmet-Pascal/issues/4
https://github.com/Alexey-T/Emmet-Pascal/issues/5

User avatar
Rickard Johansson
Site Admin
Posts: 5983
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Release v1.03. Hopefully that fixes all issues.

Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

Found new issues- by testing all Emmet docs.
Same GH page, pls see.

User avatar
Rickard Johansson
Site Admin
Posts: 5983
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Updated to version 1.04.

Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

Can you write - what are possible Syntax values?
I know -- html, xsl, svg, css
Correct?
These allowed too?- scss, sass, less, jsx?

User avatar
Rickard Johansson
Site Admin
Posts: 5983
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

I added a ReadMe.md file to the zip and updated it to v1.05. Maybe you could add it to the GitHub repository and use it instead of the Readme.txt. Make the changes to it as you see fit, e.g. adding your real name or change home page...

Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

a) Formatted .md file a little ('free Pascal'->'Free Pascal', removed bad spaces, aligned paragraph)

b) added compat with FPC release 3.0.4 (it had no Pos with 3 arguments, so I added call of PosEx). Pls take my changes to not loose them

Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

c) You have 2 funcs with "var AList: TStringList". Pls remove "var" because AList pointer is not changed, only object props are changed.

d) Can you make 2 properties:
FilenameSnippets: string (def value 'Snippets.ini')
FilenameLorem: string (def value 'Lorem.txt')
pls?
I want lowercase names (Unix case sensitive) and other names.

User avatar
Rickard Johansson
Site Admin
Posts: 5983
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Released v1.06.

Changes:
* Space should be treated as stop character.
* Implicit tag issue.
* User attribute space issue.

I also made some minor code changes and added two new properties.

Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

Thanks for update.

About sSelText. Why is it needed at all? for library it's not needed. app can just find | char and replace it with any block. If it's mul-carets, app can replace all |.
sSelText is not work for a lib.

User avatar
Rickard Johansson
Site Admin
Posts: 5983
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Wrap with Abbreviation is an important part of Emmet. And that is what sSelText is used for.

E.g. If you call ExpandAbbreviation() with

sAbbrev

Code: Select all

ul>li*
sSelText

Code: Select all

Line 1
Line 2
Line 3
Line 4
You get the result

Code: Select all

<ul>
  <li>Line 1</li>
  <li>Line 2</li>
  <li>Line 3</li>
  <li>Line 4</li>
</ul>

User avatar
Rickard Johansson
Site Admin
Posts: 5983
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Released version 1.07 with support for placeholders $# used in "Wrap with Abbreviation".

Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

I've reported a bug in GH issues pages, pls see.

Alextp
Posts: 67
Joined: 23 Aug 2014 23:36

Re: Pascal Emmet

Post by Alextp »

+ constructor Create(const ADataPath: string; const ASnippetsFile: string = '';
+ const ALoremFile: string = ''); overload;

this renders properties FilenameMMMMM as useless. Pls remove them? Its enough to pass the params on Create.

and ADataPath is useless - why to have it if we have full names in ASnippetsFile, ALoremFile?

User avatar
Rickard Johansson
Site Admin
Posts: 5983
Joined: 19 Jul 2006 14:29

Re: Pascal Emmet

Post by Rickard Johansson »

Released v1.08.

Version 1.08
* Direction issue with multiply.
* Changes to the constructior.

Alextp
Don't forget to update the readme.md file (constructor has changed). You can check the included one in the zip file.

Post Reply