Skip to content

Netstandard #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Markdig.SyntaxHighlighting.Tests/Example/CodeSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ namespace Markdig.SyntaxHighlighting.Tests.Example {
public class CodeSample {
[Fact]
public void CodeSampleWorks() {
var codebase = Assembly.GetExecutingAssembly().GetName().CodeBase;
var directory = Path.GetDirectoryName(codebase);

var location = GetType().GetTypeInfo().Assembly.Location;
var directory = Path.GetDirectoryName(location);
if (directory == null) {
throw new NullReferenceException("appPath came back null.");
}
Expand Down
110 changes: 55 additions & 55 deletions src/Markdig.SyntaxHighlighting.Tests/IntegrationTests.cs
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Markdig.SyntaxHighlighting.Tests
{
public class IntegrationTests
{
[Fact]
public void ShouldUseDefaultRendererIfLanguageIsNotIndicated() {
string testString = @"
# This is a test
```
{
""jsonProperty"": 1
}
```";
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseSyntaxHighlighting()
.Build();
var html = Markdown.ToHtml(testString, pipeline);
Assert.True(html.Contains("<pre><code>"));
Assert.True(html.Contains("jsonProperty"));
Assert.False(html.Contains("lang-"));
}
[Fact]
public void ShouldColorizeSyntaxWhenLanguageIsIndicated()
{
string testString = @"
# This is a test
```json
{
""jsonProperty"": 1
}
```";
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseSyntaxHighlighting()
.Build();
var html = Markdown.ToHtml(testString, pipeline);
Assert.True(html.Contains("<div"));
Assert.True(html.Contains("jsonProperty"));
Assert.True(html.Contains("lang-"));
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace Markdig.SyntaxHighlighting.Tests
{
public class IntegrationTests
{

[Fact]
public void ShouldUseDefaultRendererIfLanguageIsNotIndicated() {
string testString = @"
# This is a test

```
{
""jsonProperty"": 1
}
```";
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseSyntaxHighlighting()
.Build();
var html = Markdown.ToHtml(testString, pipeline);
Assert.True(html.Contains("<pre><code>"));
Assert.True(html.Contains("jsonProperty"));
Assert.False(html.Contains("lang-"));
}

[Fact]
public void ShouldColorizeSyntaxWhenLanguageIsIndicated()
{
string testString = @"
# This is a test

```json
{
""jsonProperty"": 1
}
```";
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseSyntaxHighlighting()
.Build();
var html = Markdown.ToHtml(testString, pipeline);
Assert.True(html.Contains("<div"));
Assert.True(html.Contains("jsonProperty"));
Assert.True(html.Contains("lang-"));
}

}
}
Original file line number Diff line number Diff line change
@@ -1,127 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B0696B7B-33C0-49B3-B8B2-DE07A7FCFBE9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Markdig.SyntaxHighlighting.Tests</RootNamespace>
<AssemblyName>Markdig.SyntaxHighlighting.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TargetFramework>netcoreapp1.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Reference Include="Castle.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL">
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ColorCode, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\ColorCode.Portable.1.0.3\lib\portable45-net45+win8+wp8+wpa81\ColorCode.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Markdig, Version=0.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Markdig.0.11.0\lib\net40\Markdig.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.5.16.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.5.16\lib\net45\Moq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.1.0.3179, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
<None Remove="Example\expected.html" />
<None Remove="Example\gfm.css" />
<None Remove="Example\_template.html" />
</ItemGroup>

<ItemGroup>
<Compile Include="Example\CodeSample.cs" />
<Compile Include="IntegrationTests.cs" />
<Compile Include="LanguageTypeAdapterTests.cs" />
<Compile Include="SyntaxHighlightingExtensionsTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="..\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="SyntaxHighlightingCodeBlockRendererTests.cs" />
<Compile Include="..\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" />
</ItemGroup>

<ItemGroup>
<None Include="Example\README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Markdig.SyntaxHighlighting\Markdig.SyntaxHighlighting.csproj">
<Project>{5d1e4e89-83a2-4b14-bb11-deb3c69665f0}</Project>
<Name>Markdig.SyntaxHighlighting</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Example\gfm.css">
<Content Include="Example\expected.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Example\expected.html">
<Content Include="Example\gfm.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Example\_template.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Markdig" Version="0.15.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.0" />
<PackageReference Include="Moq" Version="4.10.0" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>

<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
<ProjectReference Include="..\Markdig.SyntaxHighlighting\Markdig.SyntaxHighlighting.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Example\README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.2.0\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

</Project>
14 changes: 0 additions & 14 deletions src/Markdig.SyntaxHighlighting.Tests/packages.config

This file was deleted.

27 changes: 15 additions & 12 deletions src/Markdig.SyntaxHighlighting.sln
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Markdig.SyntaxHighlighting.Tests", "Markdig.SyntaxHighlighting.Tests\Markdig.SyntaxHighlighting.Tests.csproj", "{B0696B7B-33C0-49B3-B8B2-DE07A7FCFBE9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Markdig.SyntaxHighlighting", "Markdig.SyntaxHighlighting\Markdig.SyntaxHighlighting.csproj", "{EDBB77FA-BBEA-471B-9F94-24BD9533A7F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Markdig.SyntaxHighlighting", "Markdig.SyntaxHighlighting\Markdig.SyntaxHighlighting.csproj", "{5D1E4E89-83A2-4B14-BB11-DEB3C69665F0}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Markdig.SyntaxHighlighting.Tests", "Markdig.SyntaxHighlighting.Tests\Markdig.SyntaxHighlighting.Tests.csproj", "{CEBB07C8-7219-45DF-9195-918D4B7F01A4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B0696B7B-33C0-49B3-B8B2-DE07A7FCFBE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B0696B7B-33C0-49B3-B8B2-DE07A7FCFBE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B0696B7B-33C0-49B3-B8B2-DE07A7FCFBE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B0696B7B-33C0-49B3-B8B2-DE07A7FCFBE9}.Release|Any CPU.Build.0 = Release|Any CPU
{5D1E4E89-83A2-4B14-BB11-DEB3C69665F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5D1E4E89-83A2-4B14-BB11-DEB3C69665F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D1E4E89-83A2-4B14-BB11-DEB3C69665F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D1E4E89-83A2-4B14-BB11-DEB3C69665F0}.Release|Any CPU.Build.0 = Release|Any CPU
{EDBB77FA-BBEA-471B-9F94-24BD9533A7F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EDBB77FA-BBEA-471B-9F94-24BD9533A7F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EDBB77FA-BBEA-471B-9F94-24BD9533A7F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EDBB77FA-BBEA-471B-9F94-24BD9533A7F1}.Release|Any CPU.Build.0 = Release|Any CPU
{CEBB07C8-7219-45DF-9195-918D4B7F01A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CEBB07C8-7219-45DF-9195-918D4B7F01A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CEBB07C8-7219-45DF-9195-918D4B7F01A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CEBB07C8-7219-45DF-9195-918D4B7F01A4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {459BD81B-3844-4E63-9FA1-C7C038393D2D}
EndGlobalSection
EndGlobal
Loading