mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Added default fallback for 'Text only' if the syntax is not supported.
This commit is contained in:
parent
04c2e657ab
commit
14dee8455f
@ -103,11 +103,12 @@ namespace Teknik.Areas.Paste.Controllers
|
||||
// Transform content into HTML
|
||||
if (Highlighter.Lexers.ToList().Exists(l => l.Name == model.Syntax))
|
||||
{
|
||||
model.Syntax = "Text only";
|
||||
}
|
||||
Highlighter highlighter = new Highlighter();
|
||||
// Add a space in front of the content due to bug with pygment (No idea why yet)
|
||||
model.Content = highlighter.HighlightToHtml(" " + model.Content, model.Syntax, Config.PasteConfig.SyntaxVisualStyle, generateInlineStyles: true, fragment: true);
|
||||
}
|
||||
}
|
||||
|
||||
switch (type.ToLower())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user