Skip to content

Render GitHub emoji shortcodes missing from JoyPixels#89

Merged
ThisIs-Developer merged 2 commits intomainfrom
copilot/fix-emoji-rendering-in-markdown
May 6, 2026
Merged

Render GitHub emoji shortcodes missing from JoyPixels#89
ThisIs-Developer merged 2 commits intomainfrom
copilot/fix-emoji-rendering-in-markdown

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

GitHub-style emoji shortcodes from the provided list were showing as raw text in the preview. The gap was limited to shortcodes not covered by JoyPixels.

  • Emoji lookup fallback: Load GitHub emoji metadata on demand and render missing shortcodes as inline images during preview conversion.
  • Rendering consistency: Align inline emoji image sizing and baseline to match native emoji flow.
  • Web + desktop parity: Apply the same emoji rendering behavior in both web and desktop resource copies.

Example:

:1st_place_medal: :accessibility: :vampire_woman:

Copilot AI and others added 2 commits May 6, 2026 09:22
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/f228e998-7f39-496e-b4f1-ebb2774c3c69

Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ThisIs-Developer/Markdown-Viewer/sessions/f228e998-7f39-496e-b4f1-ebb2774c3c69

Co-authored-by: ThisIs-Developer <109382325+ThisIs-Developer@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment May 6, 2026 9:30am

@ThisIs-Developer ThisIs-Developer marked this pull request as ready for review May 6, 2026 09:31
Copilot AI review requested due to automatic review settings May 6, 2026 09:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes GitHub-style emoji shortcodes that JoyPixels can’t convert by lazily loading GitHub’s emoji metadata and rendering missing shortcodes as inline <img> elements, with consistent sizing/baseline styling across web and desktop builds.

Changes:

  • Add inline emoji <img> rendering fallback for shortcodes not supported by JoyPixels, backed by GitHub’s /emojis metadata.
  • Trigger a one-time async emoji metadata fetch when missing shortcodes are detected, then re-render the preview once data is available.
  • Add CSS to size/align inline emoji images consistently in both the web and desktop resource copies.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
styles.css Adds .emoji-inline styling for consistent inline emoji image sizing/alignment in rendered markdown.
script.js Adds GitHub emoji URL lookup + fallback rendering to inline images when JoyPixels doesn’t convert a shortcode.
desktop-app/resources/styles.css Mirrors .emoji-inline styling for desktop build parity.
desktop-app/resources/js/script.js Mirrors emoji fallback logic for desktop parity (and aligns alert modal option-building with root copy).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread script.js
Comment on lines +1567 to +1573
const image = document.createElement('img');
image.className = 'emoji-inline';
image.src = emojiUrl;
image.alt = `:${shortcode}:`;
image.loading = 'lazy';
image.setAttribute('aria-label', `:${shortcode}:`);
fragment.appendChild(image);
Comment on lines +1567 to +1573
const image = document.createElement('img');
image.className = 'emoji-inline';
image.src = emojiUrl;
image.alt = `:${shortcode}:`;
image.loading = 'lazy';
image.setAttribute('aria-label', `:${shortcode}:`);
fragment.appendChild(image);
Comment thread script.js
console.error('Failed to load GitHub emojis:', error);
emojiEntries = [];
emojiUrlMap = new Map();
emojiLookupLoaded = true;
console.error('Failed to load GitHub emojis:', error);
emojiEntries = [];
emojiUrlMap = new Map();
emojiLookupLoaded = true;
@ThisIs-Developer ThisIs-Developer merged commit ad2ea3e into main May 6, 2026
10 checks passed
@ThisIs-Developer ThisIs-Developer deleted the copilot/fix-emoji-rendering-in-markdown branch May 6, 2026 09:49
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