diff --git a/lib/page.js b/lib/page.js index 4afc1c6370f4..d16e543ee478 100644 --- a/lib/page.js +++ b/lib/page.js @@ -250,18 +250,16 @@ class Page { }) } - // set a flag so layout knows whether to render a mac/windows/linux switcher element - this.includesPlatformSpecificContent = - html.includes('extended-markdown mac') || - html.includes('extended-markdown windows') || - html.includes('extended-markdown linux') - this.detectedPlatforms = [ - html.includes('extended-markdown mac') && 'mac', - html.includes('extended-markdown windows') && 'windows', - html.includes('extended-markdown linux') && 'linux', + (html.includes('extended-markdown mac') || html.includes('platform-mac')) && 'mac', + (html.includes('extended-markdown windows') || html.includes('platform-windows')) && + 'windows', + (html.includes('extended-markdown linux') || html.includes('platform-linux')) && 'linux', ].filter(Boolean) + // set a flag so layout knows whether to render a mac/windows/linux switcher element + this.includesPlatformSpecificContent = this.detectedPlatforms.length > 0 + return html }