You are perfectly free to use it in your own code or applications. But if you're using it in a commercial product I would appreciate a donation.
The Emmet code only expand abbreviation or wrap text with abbreviation. All other editor stuff like handle tab points or multi cursors you will have to handle yourself in your own code. That's what I do in RJ TextEd.
Cheat sheets
There are a few minor differences between my version of Emmet and standard Emmet (e.g. the lorem generator).
Emmet-Pascal cheat sheet: https://www.rj-texted.se/Help/topics/em ... tsheet.htm.
Standard Emmet cheat sheet: https://docs.emmet.io/cheat-sheet/
If you improve the code you may post it in this forum.
Version 1.18 (2020-06-30)
https://github.com/rickard67/Emmet-Pascal or https://github.com/Alexey-T/Emmet-Pascal
Changes:
Version 1.18
* Single quotes in custom attributes should work now. E.g. td[title='Hello world!' colspan=3]
Version 1.17
* Fixed a Lazarus (Free Pascal) string issue in ResolveTabStopsIndex()
Version 1.16 (2020-05-19)
* Added Delphi and Lazarus demos created by Alexey. Made some minor changes to the projects to build properly in the latest versions of Delphi 10.x and Lazarus. Otherwise no changes to the Emmet.pas code.
* If the result string contain both cursor positions and tab stops - cursor positions are replaced by tab stops.
Version 1.15
* Added option to replace cursor positions | with indexed tab positions ${x}
Version 1.14
* Fixed a typo in the snippets file and updated the zip file.
Version 1.14
* Fixed ${1:tabstop} index issue
* Fixed a class issue with span tag
Version 1.13
* Added support for markdown. Supported abbreviations are:
Code: Select all
a = link
b = bold
bq = blockquote
code = inline code snippet
h1..h6 = heading
hr = horizontal rule
i = italic
img = image
ol = ordered list
pre = code block with language based highlighting
strike = strike through
table = table
ul = unordered list
@l or @l80 = create lorem generated text
Version 1.12
* Fixed a word wrap issue in Lorem generated text.
Version 1.11
* The option "CommentTags" in TExpandOptions didn't work. The |c filter did however.
* Added a number check in ProcessTagMultiplication() to prevent an infinite loop. (cMultiplicationMax = 1000)
Version 1.10
* Removed "public" keyword from TExpandOptions.
* Fixed an issue in ExtractFilters().
Version 1.09
* TEmmet can now handle some filters. A filter is added at the end of the abbreviation using a pipe |.
Code: Select all
E.g. ul>li*|t
c - Comment important tags (containing class or id attributes).
e - Escape XML-unsafe characters: <, > and &. E.g. <p>|e => <p></p>
s - Single line. Expand everything to a single line of code.
t - Trim line markers from wrapped lines e.g. "* ", "- " or "1."
w - Wordwrap selected or lorem generated text. Default width is 80.
w<x> - Wordwrap at column x. E.g. |w120 will wrap lines at column 120.
Ex.
sAbbrev = ul>li*|t
sSelText =
* Line 1
* Line 2
Result =
<ul>
<li>Line 1</li>
<li>Line 2</li>
</ul>
Options are:
Code: Select all
AddSlashToEmptyTags: Boolean; // Add a slash to empty tags e.g. <img src="" />
AlwaysAddNewLine: Boolean; // Always add linefeed after each tag (usually used in XML)
CommentTags: Boolean; // Comment important tags (containing class or id attributes).
IndentChilds: Boolean; // Indent child tags. If you set this to false - no indention will be used.
SingleLine: Boolean // Expand everything to a single line of code.
TabSize: Integer; // Tab size in characters. This is only used with wordwrap.
TrimLineMarkers: Boolean; // Trim line markers from wrapped lines e.g. "* ", "- " or "1."
Wordwrap: Boolean; // Word wrap selected or lorem generated text.
WordwrapAt: Integer; // Wrap at given column. The nearest space or symbol will be used as wrap position
* Added overload function to "ExpandAbbreviation()". The first one uses default options and the other one
enables you to set expand options.
Version 1.08
* Direction issue with multiply.
* Changes to the constructior.
Version 1.07
* Added support for placeholders $# used in "Wrap with abbreviation". The placeholder is replaced with one line of selected text.
Code: Select all
E.g.
sAbbrev = "ul>li[title=$#]*>{$#}+img[alt=$#]"
sSelText =
"About
New
Products
Contacts"
Result =
"<ul>
<li title="About">About<img src="" alt="About" /></li>
<li title="New">New<img src="" alt="New" /></li>
<li title="Products">Products<img src="" alt="Products" /></li>
<li title="Contacts">Contacts<img src="" alt="Contacts" /></li>
</ul>"
Version 1.06
* Space should be treated as stop character.
* Implicit tag issue.
* User attribute space issue.
Version 1.05
* Fixed a child indent issue.
Version 1.04
* Added standard vendor prefix "-" to CSS. E.g. -bdrs (which works the same as -v-bdrs).
* Space issue with siblings.
* A trim issue that may result in wrong indention.
* Id and class attribute issue.
Version 1.03
* Fixed several issues and updated the snippets.ini file.
Version 1.02
* Addressed some warnings in Lazarus
Version 1.01
* Fixed a multiply issue in ProcessTagMultiplication(...)