4

Post.

My Browser: Chrome Version 67.0.3396.99 (Official Build) (64-bit)

BUG: (in his code)

    regPropSuccess = SetupDiGetDeviceRegistryProperty(hDevInfo, &devInfoData, 
    SPDRP_DEVICEDESC, ®DataType, 
    (PBYTE)deviceDesc, sizeof(deviceDesc), &reqSize);

Detail: in the HTML resource code, the original code is &regDataType, but somehow it is incorrectly represented as an HTML character entity ®DataType in the end.

Is this a bug of Stack Overflow, or just a historical issue, considering that it is an eight year old question?

1

2 Answers 2

6

That was (partially) caused by incorrect indentation.

That answer used a <pre> block instead of indenting the code. This caused the parser to register the &reg part of &regDataType as ®

The fact that that did get parsed as an HTML entity does appear to be a bug, though, as there's no closing ;

Meanwhile, I've fixed the answer. It now renders correctly.

4
  • 1
    It's not a bug; it's a feature of most browsers. Which is a bug deliberately programmed in for compatibility reasons.
    – wizzwizz4
    Jul 23, 2018 at 7:11
  • @wizzwizz4: It shouldn't be parsed in code / <pre> blocks. I'd argue that this is a feature they shouldn't have built-in, if they even did so deliberately.
    – Cerbrus
    Jul 23, 2018 at 7:12
  • 1
    @Stijn Erm... because that's what the standards say? They parse all sorts of HTML!
    – wizzwizz4
    Jul 23, 2018 at 21:49
  • @Cerbrus: You can blame pretty much every invalid markup-specific "feature" like this on the thousands if not millions of websites that were written poorly and ended up relying on the behavior.
    – BoltClock
    Aug 22, 2018 at 15:54
-1

No. You've actually got a ® character in your question's source. HTML expands &reg; to ®, but Stack Overflow disables this for inside code blocks, but not manually-created <pre> blocks. Use four spaces or Ctrl + K to avoid this issue.

3
  • There was no &reg; in the source code.
    – Cerbrus
    Jul 23, 2018 at 21:49
  • Since when have browsers ever followed the standards correctly? (Actually, I think optional ; might be part of the standard but whatever.) I can guarantee that a Stack Snippet would work the same way, though. So would a jsfiddle.
    – wizzwizz4
    Jul 23, 2018 at 21:50
  • @wizzwizz4: The semicolon is required for the markup to be conforming, but the missing-semicolon behavior is standardized anyway because poorly written websites rely on it.
    – BoltClock
    Aug 22, 2018 at 15:57

You must log in to answer this question.