Slack uses &, < and > as control characters, which are replaced with their HTML equivalents (see https://api.slack.com/reference/surfaces/formatting#escaping). This can problems when asking ChatGPT about code, even when these characters appear within code blocks, e.g.,
Prompt: Is anything wrong with the angle brackets in the following C code?
Example response without this PR: Yes, there is something wrong with the angle brackets in the code. C code should use the normal angle brackets "<" and ">" for including header files. In the code you shared, "<" and ">" entities have been used instead of the normal angle brackets. This is likely due to HTML encoding, which means that the code has been copied from an HTML document where the angle brackets were replaced with those entities to prevent them from being interpreted as HTML tags. To fix it, replace "<" with "<" and ">" with ">" in the #include line.
Example response with this PR: No, there is nothing wrong with the usage of angle brackets in the code. The angle brackets are used to include standard libraries in C, in this case, stdio.h.
Thanks, the change looks good to me at a glance! I am away from keyboard right now (meaning I am writing this on mobile), so I can verify it works on my end within a few hours.
Slack uses
&
,<
and>
as control characters, which are replaced with their HTML equivalents (see https://api.slack.com/reference/surfaces/formatting#escaping). This can problems when asking ChatGPT about code, even when these characters appear within code blocks, e.g., Prompt: Is anything wrong with the angle brackets in the following C code?Example response without this PR: Yes, there is something wrong with the angle brackets in the code. C code should use the normal angle brackets "<" and ">" for including header files. In the code you shared, "<" and ">" entities have been used instead of the normal angle brackets. This is likely due to HTML encoding, which means that the code has been copied from an HTML document where the angle brackets were replaced with those entities to prevent them from being interpreted as HTML tags. To fix it, replace "<" with "<" and ">" with ">" in the #include line.
Example response with this PR: No, there is nothing wrong with the usage of angle brackets in the code. The angle brackets are used to include standard libraries in C, in this case,
stdio.h
.