@@ -21,6 +21,8 @@ import { CodeTabs } from '@/frame/components/CodeTabs'
2121import { JourneyTrackCard , JourneyTrackNav } from '@/journeys/components'
2222import { CopyMarkdownMenu } from './ViewMarkdownButton'
2323import { ExperimentContentSwap } from '@/events/components/experiments/ExperimentContentSwap'
24+ import { SelectionProvider } from '@/tools/components/SelectionContext'
25+ import { CodeTabsProvider } from '@/frame/components/CodeTabsGroup'
2426
2527const ClientSideRefresh = dynamic ( ( ) => import ( '@/frame/components/ClientSideRefresh' ) , {
2628 ssr : false ,
@@ -34,6 +36,7 @@ export const ArticlePage = () => {
3436 intro,
3537 effectiveDate,
3638 renderedPage,
39+ renderedPageHast,
3740 permissions,
3841 includesPlatformSpecificContent,
3942 includesToolSpecificContent,
@@ -77,7 +80,11 @@ export const ArticlePage = () => {
7780
7881 const articleContents = (
7982 < div id = "article-contents" >
80- < MarkdownContent > { renderedPage } </ MarkdownContent >
83+ { renderedPageHast ? (
84+ < MarkdownContent hast = { renderedPageHast } />
85+ ) : (
86+ < MarkdownContent > { renderedPage } </ MarkdownContent >
87+ ) }
8188 < ExperimentContentSwap containerRef = "#article-contents" />
8289 { effectiveDate && (
8390 < div className = "mt-4" id = "effectiveDate" >
@@ -92,56 +99,62 @@ export const ArticlePage = () => {
9299
93100 return (
94101 < DefaultLayout >
95- < LinkPreviewPopover />
96- < UtmPreserver />
97- < CodeTabs />
98- { isDev && < ClientSideRefresh /> }
99- { router . pathname . includes ( '/rest/' ) && < RestRedirect /> }
100- { currentLayout === 'inline' ? (
101- < >
102- < ArticleInlineLayout
103- supportPortalVaIframeProps = { supportPortalVaIframeProps }
104- topper = { < ArticleTitle > { title } </ ArticleTitle > }
105- intro = { introProp }
106- introCallOuts = { introCalloutsProp }
107- toc = { toc }
108- breadcrumbs = { < Breadcrumbs /> }
109- >
110- { articleContents }
111- </ ArticleInlineLayout >
112- { isJourneyTrack ? (
113- < div className = "container-lg mt-4 px-3" >
114- < JourneyTrackNav context = { currentJourneyTrack } />
115- </ div >
116- ) : null }
117- </ >
118- ) : (
119- < div className = "container-xl px-3 px-md-6 my-4" >
120- < div className = { cx ( 'd-none d-xxl-block mt-3 mr-auto width-full' ) } >
121- < Breadcrumbs />
122- </ div >
102+ < SelectionProvider >
103+ < CodeTabsProvider >
104+ < LinkPreviewPopover />
105+ < UtmPreserver />
106+ { /* The imperative CodeTabs enhancer only runs for the string fallback
107+ path; on the hast path, CodeTabsGroup renders tabs React-natively. */ }
108+ { ! renderedPageHast && < CodeTabs /> }
109+ { isDev && < ClientSideRefresh /> }
110+ { router . pathname . includes ( '/rest/' ) && < RestRedirect /> }
111+ { currentLayout === 'inline' ? (
112+ < >
113+ < ArticleInlineLayout
114+ supportPortalVaIframeProps = { supportPortalVaIframeProps }
115+ topper = { < ArticleTitle > { title } </ ArticleTitle > }
116+ intro = { introProp }
117+ introCallOuts = { introCalloutsProp }
118+ toc = { toc }
119+ breadcrumbs = { < Breadcrumbs /> }
120+ >
121+ { articleContents }
122+ </ ArticleInlineLayout >
123+ { isJourneyTrack ? (
124+ < div className = "container-lg mt-4 px-3" >
125+ < JourneyTrackNav context = { currentJourneyTrack } />
126+ </ div >
127+ ) : null }
128+ </ >
129+ ) : (
130+ < div className = "container-xl px-3 px-md-6 my-4" >
131+ < div className = { cx ( 'd-none d-xxl-block mt-3 mr-auto width-full' ) } >
132+ < Breadcrumbs />
133+ </ div >
123134
124- < ArticleGridLayout
125- supportPortalVaIframeProps = { supportPortalVaIframeProps }
126- topper = { < ArticleTitle > { title } </ ArticleTitle > }
127- intro = {
128- < >
129- { introProp }
130- { introCalloutsProp }
131- </ >
132- }
133- toc = { toc }
134- >
135- { articleContents }
136- </ ArticleGridLayout >
135+ < ArticleGridLayout
136+ supportPortalVaIframeProps = { supportPortalVaIframeProps }
137+ topper = { < ArticleTitle > { title } </ ArticleTitle > }
138+ intro = {
139+ < >
140+ { introProp }
141+ { introCalloutsProp }
142+ </ >
143+ }
144+ toc = { toc }
145+ >
146+ { articleContents }
147+ </ ArticleGridLayout >
137148
138- { isJourneyTrack ? (
139- < div className = "container-lg mt-4 px-3" >
140- < JourneyTrackNav context = { currentJourneyTrack } />
149+ { isJourneyTrack ? (
150+ < div className = "container-lg mt-4 px-3" >
151+ < JourneyTrackNav context = { currentJourneyTrack } />
152+ </ div >
153+ ) : null }
141154 </ div >
142- ) : null }
143- </ div >
144- ) }
155+ ) }
156+ </ CodeTabsProvider >
157+ </ SelectionProvider >
145158 </ DefaultLayout >
146159 )
147160}
0 commit comments