BookmarkSubscribeRSS Feed
PaigeMiller
Diamond | Level 26

When creating a code box, I want to highlight in red what the change is from the original code. So, here's a screen capture of when I am creating the message, notice there are two letters in the code box which I have highlighted in red.

 

PaigeMiller_0-1675015079348.png

 

But when the message appears in the forum, there is no red 😢

https://communities.sas.com/t5/SAS-Programming/Intnx-minus-1-day/m-p/856147#M338306

 

How can I make this code red inside a code box?

--
Paige Miller
1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello Paige,

 

I always resort to the general "Insert Code" box (</> icon) if I want to use any sort of highlighting (color, font face, font size) in code. That the "Insert SAS Code" box ("running man" icon) does not preserve such custom highlighting, can be seen in the preview window already. The corresponding HTML instructions are there (see HTML code), but appear to be overridden by the built-in code highlighting. To make them effective, one could edit the HTML code and delete the two tags <code class=" language-sas"> and </code>, leaving just <pre> your code </pre> (which is what the "Insert Code" box creates).

 

However, clicking the "HTML" icon changes the functionality of the </> icon permanently (for the current message), which may be a bug and can be very annoying! The code box now offers a drop-down menu with various programming languages (but not "plain text"), creates a third type of code box (using <li-code> tags in HTML) and without editing the HTML code there is (I think) no way back to the simple "<pre>" code box. So it's better to use the </> icon in the first place.