Based on most popular answer:
Tl;dr: to use the Swift language rules, add
<!-- language-all: lang-swift -->
to the top of your post, or use```lang-swift
at the beginning of each code block where you desire highlighting.
Highlight.js doesn't support the Excel formula language and I doubt SE would add it to the list of styles to support on the network. This has been asked for at Meta Stack Overflow too.
What's a good alternative?
For example this code:
=LAMBDA
(
vArg,
LET
(
v, INT(ABS(vArg)),
ev, ISEVEN(v),
half, 1/2,
high, INT(SQRT(v)+half),
seqLimit, 2^20,
IF
(
AND(ev, v<>2),
0,
IF
(
high>seqLimit,
-1,
LET
(
high, INT(SQRT(v)+1/2),
seq, v/SEQUENCE(1,high,1,2),
iSeq, INT(seq),
factors, seq*(seq=iSeq),
rFactors, FILTER(factors,(factors>1)*(factors<v),0),
sumFactors, SUM(rFactors)
--(sumFactors=0)
)
)
)
)
)
is rendered using the tag based (excel or lambda) or auto recognition syntax highlighting like this:
which is not perfect as the
--(sumFactors=0)
line is rendered like a comment to me which is wrong, and formula names ISEVEN
, FILTER
etc. are highlighted inconsistently.
Any suggestions of similar supported languages that may look good?