Page 1 of 1

@Admins: Syntax highlighting bug in the forum

Posted: Tue Sep 26, 2017 1:35 pm
by grump
In case you don't know yet, code syntax highlighting has bugs:

Code: Select all

-- if comments start with a keyword
-- then the comment is formatted like code

Code: Select all

-- but start one comment with a word that is not reserved
-- then it suddenly works as expected
-- until you do this:

Code: Select all

-- it breaks completely if you do this;
-- this should be a comment, not code

Code: Select all

-- like this one, that is correctly formatted

Code: Select all

-- but not this one, that is broken
-- i think it may have to do with the number of keywords in a comment?
-- if you do this, then it will break
-- even this

Code: Select all

-- i can repeat it

Code: Select all

-- i can repeat it if i want (repat is a keyword btw.)

Code: Select all

-- i can repeat it until it breaks (until too)

Code: Select all

-- i can repeat it while i break it

Code: Select all

-- i can repeat it
-- i can repeat it if i want
-- i can repeat it until it breaks
-- i can repeat it while i break it

Re: @Admins: Syntax highlighting bug in the forum

Posted: Tue Sep 26, 2017 3:48 pm
by zorg
I think i remember that there's two languages allowed, js and lua, and sometimes, js formatting kicks in... kinda stupid but meh.

Re: @Admins: Syntax highlighting bug in the forum

Posted: Tue Sep 26, 2017 3:52 pm
by bartbes
Looks like all those "broken" cases are detected as bash scripts.

EDIT: And in the post that prompted this (I assume) the code is detected as glsl.

Re: @Admins: Syntax highlighting bug in the forum

Posted: Tue Sep 26, 2017 4:18 pm
by grump
Oh, I see! I didn't realize the software would attempt to detect the programing language. I just assumed all code was parsed as Lua code in this forum.