The advanced section suggest using tags unmodified. If I use both noinclude and onlyinclude tags (within SyntaxHighlight) without modification, then SyntaxHighlight itself works perfectly. However, if I transclude that page, the onlyinclude tags are processed, because I assume, the transclusion engine doesn't look at the SyntaxHighlight tagging. I tried all sorts of work arounds ending with using an Xonlyinclude tag instead! PS. I can't surround the entire SyntaxHighlight section with noinclude tags because they also get mixed up with the ones inside the SyntaxHighlight section. Arg!
Is there a way of putting in something that looks like onlyinclude (and noinclude), that copy-and-pastes as if that was what they were, but is not looked at by the transclusion engine? Is this a bug with the transclusion engine? One solution with little extra CPU overhead is to allow nesting of noinclude tags, so in my case, if I surrounded the entire section outside SyntaxHighlight with noincludes, everything would come out fine. I would have a balanced nesting level of 2 and only when the 2nd ending is processed would transclussion continue... MediaWiki already supports nestings, but only across different tags and only with each having a depth of 1.
PS. I use MediaWiki 1.30.0. Perhaps this is already resolved...