Repository navigation
fix(build): restore dedicated .md file icon on Windows - #4284
Merged
Merged
Conversation
Blueteemo
force-pushed
the
fix/win-md-file-icon
branch
from
May 26, 2026 04:09
7ff2ee4 to
22a1e7b
Compare
Re-introduce the per-extension `icon: icons/md.ico` mapping in `fileAssociations` so Markdown files use the dedicated document icon (`build/icons/md.ico`) instead of falling back to the application logo. The dedicated icon was lost during the electron-vite refactor in marktext#4001 when each extension was split into its own entry without copying over the original `icon` field. The icon assets are still shipped via `extraResources` (`resources/icons/md.ico` is present in the install), they were simply not referenced. Apply the same icon to all six Markdown extensions (md, markdown, mmd, mdown, mdtxt, mdtext) to match v0.17.x behavior.
Blueteemo
force-pushed
the
fix/win-md-file-icon
branch
from
May 26, 2026 04:19
22a1e7b to
ae480e0
Compare
Jocs
approved these changes
May 26, 2026
Tkaixiang
approved these changes
May 26, 2026
Tkaixiang
left a comment
Member
There was a problem hiding this comment.
lgtm, builds and adds a more maintained layer. The NSIS manual writing can serve as a backup which was added for certain setups where the electron association didn't work.
thimbleberrysystems
pushed a commit
to thimbleberrysystems/WordBird
that referenced
this pull request
Jun 21, 2026
Re-introduce the per-extension `icon: icons/md.ico` mapping in `fileAssociations` so Markdown files use the dedicated document icon (`build/icons/md.ico`) instead of falling back to the application logo. The dedicated icon was lost during the electron-vite refactor in marktext#4001 when each extension was split into its own entry without copying over the original `icon` field. The icon assets are still shipped via `extraResources` (`resources/icons/md.ico` is present in the install), they were simply not referenced. Apply the same icon to all six Markdown extensions (md, markdown, mmd, mdown, mdtxt, mdtext) to match v0.17.x behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore the dedicated Markdown document icon for
.md(and other Markdown) files on Windows. After installingv0.19.0-rc.3, Markdown files in Explorer show the MarkText application logo instead of the document-style icon used byv0.17.xand earlier.develop/v0.19.0-rc.x).md→ app logo (fallback tomarktext.exe,0).md→ dedicatedmd.icodocument iconRoot cause
PR #4001 (Re-Factor MarkText with electron-vite) rewrote
electron-builder.yml. In the new file each extension is its ownfileAssociationsentry, but the originalfield (present in
v0.17.1) was not carried over to any of the new entries. With no per-association icon, electron-builder’s NSIS target falls back to the main application icon when registeringDefaultIconin the registry, which is exactly what users see now:The icon assets themselves are still shipped —
extraResourcesalready copiesbuild/icons/*.icotoresources/icons/, soresources/icons/md.icois present in the installed app. They were simply no longer referenced from the file associations.Fix
Re-add
icon: icons/md.ico(resolved againstbuildResources, i.e.build/icons/md.ico) to every Markdown extension infileAssociations. This restores the pre-refactor behavior without touching anything else.Linux and macOS file associations are unaffected (Linux doesn’t use this field; macOS file types are declared elsewhere with
icons/md.icnsalready wired up viamac.extendInfo/ dmg flow as before).Verification
Local registry check on a
v0.19.0-rc.3install confirms the regression and the fix path:Re-running the icon cache (
ie4uinit.exe -ClearIconCache && ie4uinit.exe -show) immediately switches Explorer to the document icon.I have not produced a fresh installer locally for this change (no Windows signing setup), but the patch is a one-line-per-entry config restoration of behavior that already shipped in
v0.17.x, against assets that are still present and copied into the installer.Notes
md.ico,fileAssociations,file icon, etc.) and didn’t find an existing report or fix for this specific regression..icnsreference for any platform that needs it if reviewers want it bundled in the same PR.