@@ -277,21 +277,12 @@ LOGGING:
277277 if (workspace .textType .includes (' usfm' ) && workspace .usfmWrapperType === ' xt' ) {
278278 const references = text .split (' ; ' );
279279 for (let i = 0 ; i < references .length ; i ++ ) {
280- const links = references [i ].split (' |' );
281- const displayText = links [0 ];
282- const referenceText = links .length > 1 ? links [1 ] : links [0 ];
283- const spanElement = document .createElement (' span' );
284- spanElement .classList .add (' reflink' );
285-
286- // TODO: Figure out what really needs to be added to go to references
287- // For now, just make it look consistent
288- const aElement = document .createElement (' a' );
289- aElement .setAttribute (' href' , referenceText );
290- const refText = document .createTextNode (displayText );
291- aElement .appendChild (refText );
292- spanElement .appendChild (aElement );
293-
294- workspace .tableCellElement .appendChild (spanElement );
280+ var spanV = document .createElement (' span' );
281+ spanV .classList .add (' reflink' );
282+ const refText = generateHTML (text , ' header-ref' );
283+ spanV .innerHTML = refText ;
284+ spanV .addEventListener (' click' , onClick , false );
285+ workspace .tableCellElement .appendChild (spanV );
295286 if (i < references .length - 1 ) {
296287 const textNode = document .createTextNode (' ; ' );
297288 workspace .tableCellElement .appendChild (textNode );
@@ -1272,8 +1263,8 @@ LOGGING:
12721263 }
12731264 function preprocessAction(action : string , workspace : any ) {
12741265 // Table ends if row ended and anything other than start row follows it
1275- if (! workspace .inRow && workspace .inTable && ! (action === ' startRow' )) {
1276- workspace .inTable = false ;
1266+ if (! workspace .inRow && workspace .insideTable && ! (action === ' startRow' )) {
1267+ workspace .insideTable = false ;
12771268 workspace .root .appendChild (workspace .tableElement );
12781269 }
12791270 }
@@ -1399,7 +1390,7 @@ LOGGING:
13991390 workspace .lastPhraseTerminated = false ;
14001391 workspace .currentVideoIndex = 0 ;
14011392 workspace .chapterNumText = ' ' ;
1402- workspace .inTable = false ;
1393+ workspace .insideTable = false ;
14031394 workspace .inRow = false ;
14041395 workspace .tableElement = null ;
14051396 workspace .tableRowElement = null ;
@@ -2369,10 +2360,10 @@ LOGGING:
23692360 console .log (' Start Row %o' , context .sequences [0 ].element );
23702361 }
23712362 preprocessAction (' startRow' , workspace );
2372- if (! workspace .inTable ) {
2363+ if (! workspace .insideTable ) {
23732364 workspace .tableElement = document .createElement (' table' );
23742365 workspace .tableElement .setAttribute (' cellpadding' , ' 5' );
2375- workspace .inTable = true ;
2366+ workspace .insideTable = true ;
23762367 }
23772368 workspace .inRow = true ;
23782369 workspace .tableRowElement = document .createElement (' tr' );
0 commit comments