Bläddra i källkod

Fixed line highlighting

tags/3.0.0^2
Teknikode 2 år sedan
förälder
incheckning
50e16d87cb

+ 2
- 2
Teknik/Areas/Paste/Views/Paste/Full.cshtml Visa fil

@@ -6,7 +6,7 @@
string format = Model.Syntax;
string formatName = "Text";

if (HighlightHelper.Languages.ContainsKey(format))
if (!string.IsNullOrEmpty(format) && HighlightHelper.Languages.ContainsKey(format))
{
formatName = HighlightHelper.Languages[format];
}
@@ -48,7 +48,7 @@
<br />
<div class="row">
<div class="col-sm-12">
<pre class="line-numbers"><code class="language-@(format)">@Model.Content</code></pre>
<pre class="line-numbers" id="code"><code class="language-@(format)">@Model.Content</code></pre>
</div>
</div>
</div>

+ 3
- 2
Teknik/Areas/Paste/Views/Paste/Simple.cshtml Visa fil

@@ -4,7 +4,8 @@
Layout = null;
string format = Model.Syntax;
string formatName = "Text";
if (HighlightHelper.Languages.ContainsKey(format))

if (!string.IsNullOrEmpty(format) && HighlightHelper.Languages.ContainsKey(format))
{
formatName = HighlightHelper.Languages[format];
}
@@ -26,7 +27,7 @@
</head>
<body data-twttr-rendered="true">

<pre class="line-numbers"><code class="language-@(format)">@Model.Content</code></pre>
<pre class="line-numbers" id="code" style="border: none;"><code class="language-@(format)">@Model.Content</code></pre>
<bundle src="js/common.min.js" append-version="true"></bundle>
<bundle src="js/paste.view.min.js" append-version="true"></bundle>

+ 2
- 2
Teknik/Areas/Vault/Views/Vault/PasteItem.cshtml Visa fil

@@ -4,7 +4,7 @@
string format = Model.Paste.Syntax;
string formatName = "Text";

if (HighlightHelper.Languages.ContainsKey(format))
if (!string.IsNullOrEmpty(format) && HighlightHelper.Languages.ContainsKey(format))
{
formatName = HighlightHelper.Languages[format];
}
@@ -39,7 +39,7 @@
}