优化LLM提示词

This commit is contained in:
2026-02-28 22:34:51 +08:00
parent 6beb8b5be9
commit 53f1c4902c
9 changed files with 292 additions and 30 deletions

View File

@@ -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);