Skip to content

Commit

Permalink
Make xt within table cell element work correctly (#790)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmoore1 authored Jan 24, 2025
1 parent 7646348 commit bd4f2f3
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions src/lib/components/ScriptureViewSofria.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -277,21 +277,12 @@ LOGGING:
if (workspace.textType.includes('usfm') && workspace.usfmWrapperType === 'xt') {
const references = text.split('; ');
for (let i = 0; i < references.length; i++) {
const links = references[i].split('|');
const displayText = links[0];
const referenceText = links.length > 1 ? links[1] : links[0];
const spanElement = document.createElement('span');
spanElement.classList.add('reflink');
// TODO: Figure out what really needs to be added to go to references
// For now, just make it look consistent
const aElement = document.createElement('a');
aElement.setAttribute('href', referenceText);
const refText = document.createTextNode(displayText);
aElement.appendChild(refText);
spanElement.appendChild(aElement);
workspace.tableCellElement.appendChild(spanElement);
var spanV = document.createElement('span');
spanV.classList.add('reflink');
const refText = generateHTML(text, 'header-ref');
spanV.innerHTML = refText;
spanV.addEventListener('click', onClick, false);
workspace.tableCellElement.appendChild(spanV);
if (i < references.length - 1) {
const textNode = document.createTextNode('; ');
workspace.tableCellElement.appendChild(textNode);
Expand Down

0 comments on commit bd4f2f3

Please sign in to comment.