mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Merge branch 'master' into spelling
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
// The Microsoft Corporation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Markdig;
|
||||
using Markdig.Extensions.Figures;
|
||||
using Markdig.Extensions.Tables;
|
||||
|
||||
@@ -137,6 +137,9 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.IO.Abstractions">
|
||||
<Version>12.2.5</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="..\..\..\codeAnalysis\StyleCop.json">
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.IO.Abstractions;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using Common;
|
||||
@@ -21,6 +21,10 @@ namespace Microsoft.PowerToys.PreviewHandler.Markdown
|
||||
/// </summary>
|
||||
public class MarkdownPreviewHandlerControl : FormHandlerControl
|
||||
{
|
||||
private static readonly IFileSystem FileSystem = new FileSystem();
|
||||
private static readonly IPath Path = FileSystem.Path;
|
||||
private static readonly IFile File = FileSystem.File;
|
||||
|
||||
/// <summary>
|
||||
/// Extension to modify markdown AST.
|
||||
/// </summary>
|
||||
|
||||
@@ -47,7 +47,10 @@ namespace Microsoft.PowerToys.PreviewHandler.Svg.Utilities
|
||||
var elements = doc.Descendants().ToList();
|
||||
foreach (XElement element in elements)
|
||||
{
|
||||
var elementName = element?.Name?.LocalName?.ToLower(CultureInfo.CurrentCulture);
|
||||
// Using Invariant since we are doing an exact match for HTML tags and we want it to behave the same in every culture
|
||||
#pragma warning disable CA1308 // Normalize strings to uppercase
|
||||
var elementName = element?.Name?.LocalName?.ToLowerInvariant();
|
||||
#pragma warning restore CA1308 // Normalize strings to uppercase
|
||||
if (elementName != null && blockedElementsName.ContainsKey(elementName))
|
||||
{
|
||||
foundBlockedElement = true;
|
||||
|
||||
@@ -166,7 +166,9 @@ namespace Microsoft.PowerToys.ThumbnailHandler.Svg
|
||||
{0}
|
||||
</body>
|
||||
</html>";
|
||||
return string.Format(CultureInfo.CurrentCulture, html, svg);
|
||||
|
||||
// Using InvariantCulture since this should be displayed as it is
|
||||
return string.Format(CultureInfo.InvariantCulture, html, svg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -148,6 +148,9 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.IO.Abstractions">
|
||||
<Version>12.2.5</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
@@ -54,6 +54,7 @@ namespace PreviewHandlerCommon
|
||||
|
||||
if (name != null && name.Equals(DISPIDAMBIENTDLCONTROL, StringComparison.CurrentCulture))
|
||||
{
|
||||
// Using InvariantCulture since this is used for web browser configurations
|
||||
result = Convert.ToInt32(
|
||||
WebBrowserDownloadControlFlags.DLIMAGES |
|
||||
WebBrowserDownloadControlFlags.PRAGMA_NO_CACHE |
|
||||
@@ -66,7 +67,7 @@ namespace PreviewHandlerCommon
|
||||
WebBrowserDownloadControlFlags.NO_DLACTIVEXCTLS |
|
||||
WebBrowserDownloadControlFlags.NO_RUNACTIVEXCTLS |
|
||||
WebBrowserDownloadControlFlags.NO_BEHAVIORS |
|
||||
WebBrowserDownloadControlFlags.SILENT, CultureInfo.CurrentCulture);
|
||||
WebBrowserDownloadControlFlags.SILENT, CultureInfo.InvariantCulture);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Common
|
||||
|
||||
Reference in New Issue
Block a user