Lua syntax, function keyword.

32 views
Skip to first unread message

Bas Groothedde

unread,
Oct 29, 2012, 6:10:56 AM10/29/12
to highl...@googlegroups.com
Hi there group,

I have noticed that with highlight.js, the function keyword will not be highlighted if
the parenthesis for the argument list are directly after the keyword. It is required
to have a space in between the keyword and parenthesis in order for it to highlight.

myFunction = function(a, b) -- No highlight
  return (a * b);
end

myFunction = function (a, b) -- highlighted
  return (a * b);
end

Is there any reason for this?

Ivan Sagalaev

unread,
Oct 29, 2012, 9:20:40 PM10/29/12
to highl...@googlegroups.com
Apparently, it was a bug. I just fixed it while trying to figure out
what was happening[1]. Thanks for the heads up!

[1]:
https://github.com/isagalaev/highlight.js/commit/ff0beadca4422e9d60c8582c1ea4dd6a5959e9e8

Bas Groothedde

unread,
Oct 30, 2012, 12:03:35 PM10/30/12
to highl...@googlegroups.com

awesome, thanks for the quick fix.
Reply all
Reply to author
Forward
0 new messages