优化LLM提示词
This commit is contained in:
@@ -4,14 +4,13 @@ using System.Windows.Documents;
|
||||
|
||||
using ColorCode;
|
||||
using ColorCode.Styling;
|
||||
using ColorCode.Wpf;
|
||||
|
||||
using Markdig.Parsers;
|
||||
using Markdig.Renderers;
|
||||
using Markdig.Renderers.Wpf;
|
||||
using Markdig.Syntax;
|
||||
#nullable enable
|
||||
namespace Markdig.Wpf.ColorCode;
|
||||
using Markdig.Wpf;
|
||||
namespace Szmedi.RvKits.RvScript;
|
||||
|
||||
public class ColorCodeBlockRenderer : WpfObjectRenderer<CodeBlock>
|
||||
{
|
||||
@@ -54,7 +53,7 @@ public class ColorCodeBlockRenderer : WpfObjectRenderer<CodeBlock>
|
||||
}
|
||||
|
||||
var code = ExtractCode(codeBlock);
|
||||
var formatter = new RichTextBoxFormatter(_styleDictionary);
|
||||
var formatter = new RvScript.RichTextBoxFormatter(_styleDictionary);
|
||||
var paragraph = new Paragraph();
|
||||
paragraph.SetResourceReference(FrameworkContentElement.StyleProperty, Styles.CodeBlockStyleKey);
|
||||
formatter.FormatInlines(code, language, paragraph.Inlines);
|
||||
@@ -62,7 +61,7 @@ public class ColorCodeBlockRenderer : WpfObjectRenderer<CodeBlock>
|
||||
renderer.WriteBlock(paragraph);
|
||||
}
|
||||
|
||||
private static ILanguage? ExtractLanguage(IFencedBlock fencedCodeBlock, FencedCodeBlockParser parser)
|
||||
private static ILanguage ExtractLanguage(IFencedBlock fencedCodeBlock, FencedCodeBlockParser parser)
|
||||
{
|
||||
var languageId = fencedCodeBlock.Info!.Replace(parser.InfoPrefix!, string.Empty);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user