From 5c37b009f375a6369b168cec2e8b375a75fb24f5 Mon Sep 17 00:00:00 2001 From: skycommand Date: Tue, 8 Feb 2022 23:53:28 +0330 Subject: [PATCH] Register .markdown with the correct handler --- src/common/utils/modulesRegistry.h | 18 ++++++++---------- .../MonacoPreviewHandler/languages.json | 19 ------------------- 2 files changed, 8 insertions(+), 29 deletions(-) diff --git a/src/common/utils/modulesRegistry.h b/src/common/utils/modulesRegistry.h index 48b2487628..cb9912f94a 100644 --- a/src/common/utils/modulesRegistry.h +++ b/src/common/utils/modulesRegistry.h @@ -13,8 +13,6 @@ namespace NonLocalizable const static wchar_t* MONACO_LANGUAGES_FILE_NAME = L"modules\\FileExplorerPreview\\languages.json"; const static wchar_t* ListID = L"list"; const static wchar_t* ExtensionsID = L"extensions"; - const static wchar_t* MDExtension = L".md"; - const static wchar_t* SVGExtension = L".svg"; } inline registry::ChangeSet getSvgPreviewHandlerChangeSet(const std::wstring installationDir, const bool perUser) @@ -44,7 +42,14 @@ inline registry::ChangeSet getMdPreviewHandlerChangeSet(const std::wstring insta registry::DOTNET_COMPONENT_CATEGORY_CLSID, L"Microsoft.PowerToys.PreviewHandler.Markdown.MarkdownPreviewHandler", L"Markdown Preview Handler", - { L".md" }); + { L".md", + L".markdown", + L".mdown", + L".mkdn", + L".mkd", + L".mdwn", + L".mdtxt", + L".mdtext" }); } inline registry::ChangeSet getMonacoPreviewHandlerChangeSet(const std::wstring installationDir, const bool perUser) @@ -68,13 +73,6 @@ inline registry::ChangeSet getMonacoPreviewHandlerChangeSet(const std::wstring i for (uint32_t j = 0; j < extensionsList.Size(); ++j) { auto extension = extensionsList.GetStringAt(j); - - // Ignore extensions we already have dedicated handlers for - if (std::wstring{ extension } == std::wstring{ NonLocalizable::MDExtension } || - std::wstring{ extension } == std::wstring{ NonLocalizable::SVGExtension }) - { - continue; - } extensions.push_back(std::wstring{ extension }); } } diff --git a/src/modules/previewpane/MonacoPreviewHandler/languages.json b/src/modules/previewpane/MonacoPreviewHandler/languages.json index d82808427f..28c09759a0 100644 --- a/src/modules/previewpane/MonacoPreviewHandler/languages.json +++ b/src/modules/previewpane/MonacoPreviewHandler/languages.json @@ -431,23 +431,6 @@ "m3" ] }, - { - "id": "markdown", - "extensions": [ - ".md", - ".markdown", - ".mdown", - ".mkdn", - ".mkd", - ".mdwn", - ".mdtxt", - ".mdtext" - ], - "aliases": [ - "Markdown", - "markdown" - ] - }, { "id": "mips", "extensions": [ @@ -924,8 +907,6 @@ ".wxl", ".wxs", ".xaml", - ".svg", - ".svgz", ".opf", ".xsl" ],