mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Changed to use own Pygments nuget package.
This commit is contained in:
parent
35be0dd3a9
commit
2eb9463df7
@ -6,7 +6,7 @@ using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using FearTheCowboy.Pygments;
|
||||
using Teknik.Pygments;
|
||||
using Teknik.Areas.Error.Controllers;
|
||||
using Teknik.Areas.Paste.ViewModels;
|
||||
using Teknik.Areas.Users.Utility;
|
||||
@ -101,9 +101,9 @@ namespace Teknik.Areas.Paste.Controllers
|
||||
if (type.ToLower() == "full" || type.ToLower() == "simple")
|
||||
{
|
||||
// Transform content into HTML
|
||||
if (Highlighter.Lexers.ToList().Exists(l => l.Name == model.Syntax))
|
||||
if (!Highlighter.Lexers.ToList().Exists(l => l.Aliases.Contains(model.Syntax)))
|
||||
{
|
||||
model.Syntax = "Text only";
|
||||
model.Syntax = "text";
|
||||
}
|
||||
Highlighter highlighter = new Highlighter();
|
||||
// Add a space in front of the content due to bug with pygment (No idea why yet)
|
||||
|
@ -1,7 +1,7 @@
|
||||
@model Teknik.Areas.Paste.ViewModels.PasteCreateViewModel
|
||||
|
||||
@using Teknik.Helpers
|
||||
@using FearTheCowboy.Pygments
|
||||
@using Teknik.Pygments
|
||||
|
||||
@Styles.Render("~/Content/paste")
|
||||
@Scripts.Render("~/bundles/paste")
|
||||
@ -33,11 +33,11 @@
|
||||
<label for="syntax" class="col-sm-2 col-sm-offset-1 control-label">Syntax</label>
|
||||
<div class="col-sm-4">
|
||||
<select class="form-control" name="Syntax" id="syntax">
|
||||
<option value="Text only">Text only</option>
|
||||
<option value="text">Text only</option>
|
||||
@{
|
||||
foreach (Highlighter.Lexer format in Highlighter.Lexers.OrderBy(l => l.Name))
|
||||
{
|
||||
<option value="@format.Name">@format.Name</option>
|
||||
<option value="@format.Aliases.FirstOrDefault()">@format.Name</option>
|
||||
}
|
||||
}
|
||||
</select>
|
||||
|
@ -18,6 +18,7 @@
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="System.Web.Optimization" />
|
||||
<add namespace="Teknik" />
|
||||
<add namespace="Teknik.Pygments" />
|
||||
|
||||
</namespaces>
|
||||
</pages>
|
||||
|
@ -61,10 +61,6 @@
|
||||
<HintPath>..\packages\EntityFramework.6.1.3\lib\net45\EntityFramework.SqlServer.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FearTheCowboy.Pygments, Version=2.0.2.2, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FearTheCowboy.Pygments.2.0.2.2\lib\net40\FearTheCowboy.Pygments.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="MarkdownDeep, Version=1.5.4615.26275, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MarkdownDeep.NET.1.5\lib\.NetFramework 3.5\MarkdownDeep.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -162,6 +158,10 @@
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="Teknik.Pygments, Version=2.0.2.3, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Teknik.Pygments.2.0.2.3\lib\net40\Teknik.Pygments.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="TwoStepsAuthenticator, Version=1.1.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\TwoStepsAuthenticator.1.2.0\lib\net45\TwoStepsAuthenticator.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -517,7 +517,9 @@
|
||||
<Content Include="Areas\Help\Views\Help\Upload.cshtml" />
|
||||
<Content Include="Areas\API\Views\web.config" />
|
||||
<Content Include="Areas\Help\Views\Help\API\v1\Upload.cshtml" />
|
||||
<Content Include="Areas\Paste\Views\web.config" />
|
||||
<Content Include="Areas\Paste\Views\web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="Areas\Paste\Views\Paste\Index.cshtml" />
|
||||
<Content Include="Areas\Paste\Views\_ViewStart.cshtml" />
|
||||
<Content Include="Areas\Paste\Views\Paste\Full.cshtml" />
|
||||
|
@ -6,7 +6,6 @@
|
||||
<package id="Bootstrap.Switch" version="3.3.2.1" targetFramework="net452" />
|
||||
<package id="BouncyCastle" version="1.8.1" targetFramework="net452" />
|
||||
<package id="EntityFramework" version="6.1.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="FearTheCowboy.Pygments" version="2.0.2.2" targetFramework="net462" />
|
||||
<package id="FontAwesome" version="4.6.3" targetFramework="net452" userInstalled="true" />
|
||||
<package id="GitVersionTask" version="3.6.4" targetFramework="net452" developmentDependency="true" />
|
||||
<package id="Inferno" version="1.4.0" targetFramework="net452" userInstalled="true" />
|
||||
@ -31,6 +30,7 @@
|
||||
<package id="Piwik.Tracker" version="2.16.0.0" targetFramework="net452" />
|
||||
<package id="QRCoder" version="1.2.2" targetFramework="net452" />
|
||||
<package id="Respond" version="1.4.2" targetFramework="net452" userInstalled="true" />
|
||||
<package id="Teknik.Pygments" version="2.0.2.3" targetFramework="net462" />
|
||||
<package id="TwoStepsAuthenticator" version="1.2.0" targetFramework="net452" />
|
||||
<package id="WebGrease" version="1.6.0" targetFramework="net46" userInstalled="true" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user