rickard67 / emmet-pascal Goto Github PK
View Code? Open in Web Editor NEWEmmet components for use in Delphi or Lazarus
License: Other
Emmet components for use in Delphi or Lazarus
License: Other
In my app, #nn
expands to <div id="nn"></div>
But, #dd
expands to #<dd></dd>
Can you check it in RJ-TextEd?
https://html.spec.whatwg.org/multipage/syntax.html#void-elements tells that track
is a void tag!
but track.nn
->
<track class="n"></track>
wbr
must also be void!
but wbr.nn
->
<wbr class="nn"></wbr>
embed.nn
gives
<embed src="" type="" class="nn"/>
Result := StringReplace(Result, '\n', #13#10, [rfReplaceAll]);
Result := StringReplace(Result, '\t', #9, [rfReplaceAll]);
occurs N times. DRY principle.
HTML syntax.
<bod
gives strange line <bod</bo>
.<body
gives bad line <body</bod>
I pass Sorted
stringlist. then you do:
procedure TEmmet.AddHTMLTagListForValidation(const AList: TStringList);
begin
if not Assigned(AList) or (AList.Count = 0) then Exit;
// Ignore and exit if list is already populated
if Assigned(FHTMLTagList) then Exit;
// Create a sorted list of added tags
FHTMLTagList := TStringList.Create;
FHTMLTagList.Assign(AList);
FHTMLTagList.CaseSensitive := False;
FHTMLTagList.Sort;
if not FHTMLTagList.Sorted then //Alex added
raise exception.create('dd'); //raised!!
end;
Sorted
is reset, then Find method gives the exception.
FPC 3.2.3.
Many apps need this code. So the idea.
Find URLs in the AnsiString and UnicodeString - without using RegEx.
By custom Pascal code.
First, search must find one of possible beginnings:
If OK beginning exists, do the complex search for ending. Ending:
Why the idea? Avoid slow search by RegEx. What do you think @rickard67 ?
function TEmmet.GetLineCount(const s: string): Integer;
var
n: Integer;
begin
Result := 1;
n := Pos(#10,s);
while n > 0 do
begin
Inc(Result);
n := PosEx(#10,s,n+1);
end;
end;
Simpler code can be
using of S.CountChar(#10) + 1
.
https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.countchar.html (fpc) / https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.TStringHelper.CountChar (delphi).
or using this simple func.
function CountOfChar(ch: Char; const S: string): Integer;
var
i: Integer;
begin
Result := 0;
for i := 1 to Length(S) do
if S[i] = ch then
Inc(Result);
end;
emmet.pas(484,3) Note: Local variable "n" not used
[snippets-css]
!=!important
->
[snippets-css]
!=!important|
this pipe-char added, allows to put caret after !important
so user don't have to press END each time!
VSCode allows this
lorem[tab]
->
lorem text with about 30 words
Currently Emmet-Pascal makes <lorem></lorem>
- nonsense.
p*2>lorem[tab]
->
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Qui dicta minus
molestiae vel beatae natus eveniet ratione temporibus aperiam harum alias
officiis assumenda officia quibusdam deleniti eos cupiditate dolore doloribus!
</p>
<p>
Ad dolore dignissimos asperiores dicta facere optio quod commodi nam tempore
recusandae. Rerum sed nulla eum vero expedita ex delectus voluptates rem at
neque quos facere sequi unde optio aliquam!
</p>
Please make like VS Code.
test
1
wrap with abbreviation -> p
<p>
test
</p>
2
wrap with abbreviation -> p*
<p>test</p>
sublime text 4
wrap with abbreviation -> p == wrap with abbreviation -> p*
<p>test</p>
img, and some other tags (2-4 tags, or all other tags?) give redundant space before class="nn"
img.nn
->
<img src="" alt="" class="nn"/>
base.nn
->
<base href="" class="nn"/>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.