Skip to content

Fix: Render HTML in dataset explorer long description#1206

Merged
adkinsrs merged 2 commits intoIGS:develfrom
Swargambharath987:fix/dataset-explorer-html-description
Apr 6, 2026
Merged

Fix: Render HTML in dataset explorer long description#1206
adkinsrs merged 2 commits intoIGS:develfrom
Swargambharath987:fix/dataset-explorer-html-description

Conversation

@Swargambharath987
Copy link
Copy Markdown
Contributor

Fixes
#1164

The long description field in the dataset explorer result card was using .textContent, which renders HTML tags as plain text. Changed to .innerHTML so descriptions
with embedded HTML are rendered correctly, consistent with how the Dataset Information dialog already handles it.

@jorvis
Copy link
Copy Markdown
Member

jorvis commented Mar 1, 2026

Thanks for your contribution here! I like this change. Did you happen to check if it passes a cycle of edit, save, and display again with embedded html?

@jorvis jorvis self-assigned this Mar 1, 2026
@Swargambharath987
Copy link
Copy Markdown
Contributor Author

Thanks for checking @jorvis! I looked at the code and line 625 in the same file covers the after-save update path as well, so both the initial render and the edit/display cycle should be handled. That said, I haven't been able to test it on a live instance, happy to update if you spot anything!

@adkinsrs
Copy link
Copy Markdown
Member

I think for the two innerHTML assignments, we need to ensure the value is treated as HTML

See

gEAR/www/js/common.v2.js

Lines 624 to 628 in 045b165

toast.appendChild(opts?.isHTML ? (() => {
const span = document.createElement("span");
span.innerHTML = msg;
return span;
})() : document.createTextNode(msg));
where the potential HTML value is wrapped in a tag

@Swargambharath987
Copy link
Copy Markdown
Contributor Author

Swargambharath987 commented Mar 27, 2026

Updated both innerHTML assignments to wrap the value in a span element, consistent with the pattern in
common.v2.js. Tested on a live local instance using the "P1, mouse, scRNA-seq, cochlear epithelium (Kelley)" dataset — HTML in the long description (including clickable link) now renders correctly instead of showing as raw tags. Confirmed the incorrect behavior on umgear.org where the same dataset shows raw HTML tags, validating the fix.

@adkinsrs adkinsrs merged commit 275b1e5 into IGS:devel Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants