Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enlighter won't work in first word #129

Closed
Irwnda opened this issue Aug 18, 2020 · 7 comments
Closed

Enlighter won't work in first word #129

Irwnda opened this issue Aug 18, 2020 · 7 comments

Comments

@Irwnda
Copy link

Irwnda commented Aug 18, 2020

I'm new at this plugin. I just want to ask why it won't work in the very first word?
Screenshot from 2020-08-18 18-52-53

It works if I add space before. But I don't want to do that.

@AndiDittrich
Copy link
Member

hi @Irwanda04 ,

which language ? can you provide the example code above ? thanks!

@AndiDittrich AndiDittrich transferred this issue from EnlighterJS/Plugin.WordPress Aug 18, 2020
@Irwnda
Copy link
Author

Irwnda commented Aug 18, 2020

I used generic highlighting for that.
And here is if i add space
Screenshot from 2020-08-18 19-10-12

@Irwnda
Copy link
Author

Irwnda commented Aug 18, 2020

function abc(a:integer) : integer;
begin
abc :=a*3-(a mod 7);
{a}
end;

function ghi(x:integer;b:integer):integer;
begin
if (b=1) then
ghi := x
else
ghi := (x* ghi(x,b-1)) mod 100;
end;

function def(a:integer; b:integer) : integer;
begin
if (b mod 2 = 1) and (b>500) then
def := ghi(a,b) mod 100
{b}
else
def:=def(a, abc(b)) ;
end;

@AndiDittrich
Copy link
Member

it's caused by the regex rule within the generic ruleset - it currently requires a non word character before+after the keywords ("function" is just a keyword)

@AndiDittrich
Copy link
Member

image

@AndiDittrich
Copy link
Member

fixed in the master branch

@Irwnda
Copy link
Author

Irwnda commented Aug 18, 2020

Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants