Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
I've seen that recently two requests to add syntax highlight to some languages were deferred (this and this). According to the status-deferred tag description: "the requested feature will not be i...
#3: Post edited
- I've seen that recently two requests to add syntax highlight to some languages were deferred ([this](https://software.codidact.com/posts/279676) and [this](https://software.codidact.com/posts/283059)).
- According to the [status-deferred tag description](https://software.codidact.com/categories/39/tags/3290): "*the requested feature will not be implemented in the near future*".
- From that description, my understanding is that there's not a timeline defined, and perhaps no guarantee that this will be made at all.
- While we wait/hope for it, what's the workaround for highlighting code blocks with those languages? I can think of two alternatives:
- - leave the post as is, and when/if highlight for that language is added, no change will be needed. IMO, it's bad because the code won't be highlighted until support for the language is added (which can possibly mean "forever").
- - change the code block to use some language that has syntax highlight enabled and is "close enough" to the block's original language. IMO, it's "good" because at least the code will have some highlight (not-so-accurate _may be_ better than nothing). I'm not sure if this affects the site's "semantics", as the blocks will have a CSS class with the wrong language in its name (not to mention the need to revert those if highlight for the original language is added).
While there are few posts containing code with the languages involved, option 2 seems to be the best alternative (not ideal, but good enough considering the circustances). But as the site grows, this has the possibility to become a burden, for example: a mass edit might be required to revert the workaround.- Is there another alternative? Another pros and cons to the above?
- I've seen that recently two requests to add syntax highlight to some languages were deferred ([this](https://software.codidact.com/posts/279676) and [this](https://software.codidact.com/posts/283059)).
- According to the [status-deferred tag description](https://software.codidact.com/categories/39/tags/3290): "*the requested feature will not be implemented in the near future*".
- From that description, my understanding is that there's not a timeline defined, and perhaps no guarantee that this will be made at all.
- While we wait/hope for it, what's the workaround for highlighting code blocks with those languages? I can think of two alternatives:
- - leave the post as is, and when/if highlight for that language is added, no change will be needed. IMO, it's bad because the code won't be highlighted until support for the language is added (which can possibly mean "forever").
- - change the code block to use some language that has syntax highlight enabled and is "close enough" to the block's original language. IMO, it's "good" because at least the code will have some highlight (not-so-accurate _may be_ better than nothing). I'm not sure if this affects the site's "semantics", as the blocks will have a CSS class with the wrong language in its name (not to mention the need to revert those if highlight for the original language is added).
- While there are few posts containing code with the languages involved, option 2 seems to be the best alternative (not ideal, but good enough considering the circumstances). But as the site grows, this has the possibility to become a burden — for example, a mass edit might be required to revert the workaround.
- Is there another alternative? Another pros and cons to the above?
#1: Initial revision
Is there a workaround to highlight code blocks if the language doesn't have syntax highlight enabled?
I've seen that recently two requests to add syntax highlight to some languages were deferred ([this](https://software.codidact.com/posts/279676) and [this](https://software.codidact.com/posts/283059)). According to the [status-deferred tag description](https://software.codidact.com/categories/39/tags/3290): "*the requested feature will not be implemented in the near future*". From that description, my understanding is that there's not a timeline defined, and perhaps no guarantee that this will be made at all. While we wait/hope for it, what's the workaround for highlighting code blocks with those languages? I can think of two alternatives: - leave the post as is, and when/if highlight for that language is added, no change will be needed. IMO, it's bad because the code won't be highlighted until support for the language is added (which can possibly mean "forever"). - change the code block to use some language that has syntax highlight enabled and is "close enough" to the block's original language. IMO, it's "good" because at least the code will have some highlight (not-so-accurate _may be_ better than nothing). I'm not sure if this affects the site's "semantics", as the blocks will have a CSS class with the wrong language in its name (not to mention the need to revert those if highlight for the original language is added). While there are few posts containing code with the languages involved, option 2 seems to be the best alternative (not ideal, but good enough considering the circustances). But as the site grows, this has the possibility to become a burden, for example: a mass edit might be required to revert the workaround. Is there another alternative? Another pros and cons to the above?