OfficeDocs-Support icon indicating copy to clipboard operation
OfficeDocs-Support copied to clipboard

Comments in code blocks are broken

Open yoraaf opened this issue 3 years ago • 4 comments

The ' symbol is supposed to start a line comment in VB but the text highlighting of the code blocks seems to treat it as a string character. If you look at this screenshot https://prnt.sc/13o51vq you can see the issue.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

yoraaf avatar Jun 01 '21 13:06 yoraaf

@yoraaf The code itself is correct. It works if you compile it. What exactly would you change in the article?

VLG17 avatar Jun 07 '21 18:06 VLG17

@VLG17 The issue is not with the code itself, but with the syntax highlighting. If you look on the page, all text between two ' characters is highlighted as if its a string instead of it highlighting only one line as a comment. This also results in some comments being highlighted as if it is code instead of being highlighted as a comment.

yoraaf avatar Jun 07 '21 18:06 yoraaf

The code seems to compile and I can step through it in Excel just fine. Maybe they should use Copy instead of text highlighting for coping the code over?

jlriesco avatar Aug 26 '21 16:08 jlriesco

Since my original post, the issue has already been fixed. To clarify, my issue was never with the code itself (I know that it runs and compiles fine) but with the way the website handled the highlighting of said code (as you can see in my original screenshot). Here is a screenshot comparing how it looked before and after it was fixed https://i.imgur.com/saXFsl3.png VB

I hope this has finally clarified what my original problem was, and with that I will close this issue as it has been fixed already.

yoraaf avatar Aug 28 '21 13:08 yoraaf