10

When I edited a SO post, I noticed an error in highlighting assembly code sample.
Not only formatting is not applied when using assembly nor x84asm language identifiers, but it looks bad even if using lang-avrasm identifier, as suggested in this answer.

Code sample using lang-avrasm identifier:

.data
num: .int 2     # Declare an integer variable num with value 2

.text
.globl _start

_start:
    movl num, %eax # num stores an address, take the value inside that address into eax
    movl $num, %ebx # num stores an address, $ tells us to take the address itself into ebx
    leal num, %ecx # num stores an address, take the address itself into ecx (lea)

    #initialize
    movl $0, %eax
    movl $0, %ebx
    movl $0, %ecx

    movl $num, %edx # num stores an address, take the address itself into edx
    movl %edx, %eax # edx is an address, take the value inside that address into eax
    leal (%edx), %ecx # () tells us to go to the address inside edx, take the address itself into ecx (lea)
    movl (%edx), %ebx # () tells us to go to the address inside edx, take the value inside that address into ebx

    # Exit
    movl $1, %eax     # System call number for exit
    xorl %ebx, %ebx   # Exit status 0
    int $0x80         # Invoke the syscall

You see that code comments are grayed at least, but HEX values are not highlighted correctly.

Then I did some research and figured out, that currently used version of highlight.js library is 11.5.1, released two years ago.
Current version is 11.9 and the same code looks better on a library demo page.

Is it possible to upgrade?
On meta it is stated, that new versions of highlight.js are deployed on the sites on a scheduled basis.
I do not know about time schedule, but I think two years is quite long time, is it not?

10
  • 2
    Two years is a very short time, in SE terms. They don't upgrade per request, sadly. (i.e. dead end, we'll just have to wait 6-8 years, possibly much more.) Commented Apr 4 at 8:11
  • Maybe if this question gets upvoted, they notice it at least. Also what you say is in contrast to what is written in linked meta post. At very least they could specify what long time means.
    – Jerry
    Commented Apr 4 at 8:36
  • 2
    I mean, we can ask. They will do it in their own time. (And no, score has no value for SE, they treat -1000 bug same as +2000 bug) Commented Apr 4 at 8:58
  • This is feature-request, not bug (nor discussion).
    – Jerry
    Commented Apr 4 at 9:20
  • Syntax highlighting can be considered forever broken (for on the order of 100 million posts on Stack Exchange). It is probably never going to be fixed. Even though it is blindingly obvious just by looking at a random selection of a few Stack Overflow pages. It is embarrassing, especially for a multi-billion USD company. For example, it ought to be turned off by default instead of being enabled by default. An external dependency is a very poor excuse. Commented Apr 6 at 17:56
  • Related: Missing syntax-highlighting for x86 assembly Commented Apr 6 at 17:58
  • @This_is_NOT_a_forum you do not understand. This related post you add is 6 years old, long time before highlight.js was implemented on SE. It is not relevant. I'm not asking to implement assembly highlighting on SE, I'm asking to upgrade version of 3rd party library. Which should be upgraded on regular basis anyway. I edited title, to be more clear.
    – Jerry
    Commented Apr 7 at 7:38
  • 1
    This isn't because SE's version of the library is out-of-date. The actual cause is that SE doesn't support the language hints for assembly that you're using. See the Note to editors in the syntax highlighting FAQ you linked to. Commented Apr 7 at 7:47
  • @Sonic That note is outdated too - in terms of supported languages. Some of the languages specified on highlight.js docs and not listed in FAQ work without (obvious) issues (lang-applescript for example), some of them (like assembly) not. Embedding highlight.js library in SE editor is another problem.
    – Jerry
    Commented Apr 7 at 8:19
  • 1
    That page links to a script which obtains the highlight.js instance from SE and enumerates the languages it's built with. Neither AppleScript nor assembly are in the list it outputs. As far as why you see the former appearing to work, keep in mind that invalid identifiers trigger an automatic language detection, which may be recognizing a "close" language that's not the same. Commented Apr 7 at 8:23

0

You must log in to answer this question.

Browse other questions tagged .