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 @@ -183,13 +183,35 @@ function analyticsScript(analytics) {
183
183
` ;
184
184
}
185
185
186
+ // replace placeholders in text tokens
187
+ function replaceInText ( text ) {
188
+ return linkJsTypeDocs ( linkManPages ( text ) ) ;
189
+ }
190
+
186
191
// handle general body-text replacements
187
192
// for example, link man page references to the actual page
188
193
function parseText ( lexed ) {
189
194
lexed . forEach ( function ( tok ) {
190
- if ( tok . text && tok . type !== 'code' ) {
191
- tok . text = linkManPages ( tok . text ) ;
192
- tok . text = linkJsTypeDocs ( tok . text ) ;
195
+ if ( tok . type === 'table' ) {
196
+ if ( tok . cells ) {
197
+ tok . cells . forEach ( ( row , x ) => {
198
+ row . forEach ( ( _ , y ) => {
199
+ if ( tok . cells [ x ] && tok . cells [ x ] [ y ] ) {
200
+ tok . cells [ x ] [ y ] = replaceInText ( tok . cells [ x ] [ y ] ) ;
201
+ }
202
+ } ) ;
203
+ } ) ;
204
+ }
205
+
206
+ if ( tok . header ) {
207
+ tok . header . forEach ( ( _ , i ) => {
208
+ if ( tok . header [ i ] ) {
209
+ tok . header [ i ] = replaceInText ( tok . header [ i ] ) ;
210
+ }
211
+ } ) ;
212
+ }
213
+ } else if ( tok . text && tok . type !== 'code' ) {
214
+ tok . text = replaceInText ( tok . text ) ;
193
215
}
194
216
} ) ;
195
217
}
You can’t perform that action at this time.
0 commit comments