Skip to content

Fix apostrophes displayed as HTML entities in Files pane - #16814

Merged
kevinushey merged 3 commits into
mainfrom
fix/apostrophe-html-entity-display
Jan 13, 2026
Merged

kevinushey merged 3 commits into
mainfrom
fix/apostrophe-html-entity-display

Conversation

@kevinushey

@kevinushey kevinushey commented Jan 12, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

Addresses #16808

Summary

Fixes apostrophes being displayed as ' in the Files pane (both in the file name and the hover tooltip) on Windows with French locale.

The bug was introduced in commit bffbcf7 (May 2025) when LinkColumn.java was refactored to use SafeHtmlTemplates. The template was using value.asString() which returns HTML-escaped text, then passing it as a String parameter which gets escaped again by the template:

@Template("<div class=\"{0}\" title=\"{1}\">{1}</div>")
SafeHtml render(String className, String title);

// Called with:
sb.append(NAME_TEMPLATE.render(classNames, value.asString()));

Fix

Use SafeHtml parameter directly, which renders entities correctly in both the title attribute and visible content:

@Template("<div class=\"{0}\" title=\"{1}\">{1}</div>")
SafeHtml render(String className, SafeHtml value);

// Called with:
sb.append(NAME_TEMPLATE.render(classNames, value));

Test plan

  • Create a folder or file with an apostrophe in the name (e.g., "It's a test")
  • Verify it displays correctly in the Files pane (not as It&#39;s a test)
  • Verify the tooltip (title attribute) also shows correctly on hover

🤖 Generated with Claude Code

@posit-snyk-bot

posit-snyk-bot commented Jan 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

The SafeHtmlTemplate was using value.asString() which returns HTML-escaped
text, then passing it as a String parameter which gets escaped again by
the template. This caused entities like &#39; to be displayed literally.

Fix by using SafeHtml parameter directly, which renders entities correctly
in both the title attribute and visible content.

Fixes #16808

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@kevinushey
kevinushey force-pushed the fix/apostrophe-html-entity-display branch from 19f579a to 8c41c43 Compare January 12, 2026 19:57
@kevinushey
kevinushey marked this pull request as draft January 12, 2026 20:02
@kevinushey kevinushey added this to the Globemaster Allium milestone Jan 12, 2026
@kevinushey
kevinushey requested a review from gtritchie January 12, 2026 20:16
@kevinushey
kevinushey marked this pull request as ready for review January 12, 2026 20:16
@gtritchie

Copy link
Copy Markdown
Member

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@gtritchie gtritchie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kevinushey
kevinushey merged commit e923c51 into main Jan 13, 2026
@kevinushey
kevinushey deleted the fix/apostrophe-html-entity-display branch January 13, 2026 00:46
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