File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -162,13 +162,35 @@ function analyticsScript(analytics) {
162162 ` ;
163163}
164164
165+ // replace placeholders in text tokens
166+ function replaceInText ( text ) {
167+ return linkJsTypeDocs ( linkManPages ( text ) ) ;
168+ }
169+
165170// handle general body-text replacements
166171// for example, link man page references to the actual page
167172function parseText ( lexed ) {
168173 lexed . forEach ( function ( tok ) {
169- if ( tok . text && tok . type !== 'code' ) {
170- tok . text = linkManPages ( tok . text ) ;
171- tok . text = linkJsTypeDocs ( tok . text ) ;
174+ if ( tok . type === 'table' ) {
175+ if ( tok . cells ) {
176+ tok . cells . forEach ( ( row , x ) => {
177+ row . forEach ( ( _ , y ) => {
178+ if ( tok . cells [ x ] && tok . cells [ x ] [ y ] ) {
179+ tok . cells [ x ] [ y ] = replaceInText ( tok . cells [ x ] [ y ] ) ;
180+ }
181+ } ) ;
182+ } ) ;
183+ }
184+
185+ if ( tok . header ) {
186+ tok . header . forEach ( ( _ , i ) => {
187+ if ( tok . header [ i ] ) {
188+ tok . header [ i ] = replaceInText ( tok . header [ i ] ) ;
189+ }
190+ } ) ;
191+ }
192+ } else if ( tok . text && tok . type !== 'code' ) {
193+ tok . text = replaceInText ( tok . text ) ;
172194 }
173195 } ) ;
174196}
You can’t perform that action at this time.
0 commit comments