Merge branch 'master' into spelling

This commit is contained in:
Clint Rutkas
2020-11-02 09:57:48 -08:00
committed by GitHub
245 changed files with 2177 additions and 1210 deletions

View File

@@ -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;

View File

@@ -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">

View File

@@ -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>

View File

@@ -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;

View File

@@ -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>

View File

@@ -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" />

View File

@@ -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;

View File

@@ -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
{

View File

@@ -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