mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-24 15:10:46 +00:00
fix: lint
This commit is contained in:
@@ -2,29 +2,29 @@ import { marked } from "marked";
|
||||
import DOMPurify from "isomorphic-dompurify";
|
||||
|
||||
interface MarkedOptions {
|
||||
gfm: boolean;
|
||||
breaks: boolean;
|
||||
headerIds: boolean;
|
||||
mangle: false;
|
||||
highlight?: (code: string, lang: string) => string;
|
||||
gfm: boolean;
|
||||
breaks: boolean;
|
||||
headerIds: boolean;
|
||||
mangle: false;
|
||||
highlight?: (code: string, lang: string) => string;
|
||||
}
|
||||
|
||||
// Configure marked options
|
||||
const markedOptions: MarkedOptions = {
|
||||
gfm: true, // GitHub Flavored Markdown
|
||||
breaks: true, // Convert \n to <br>
|
||||
headerIds: true, // Add ids to headers
|
||||
mangle: false, // Don't escape HTML
|
||||
highlight: function (code: string, lang: string): string {
|
||||
// You can add syntax highlighting here if needed
|
||||
return code;
|
||||
},
|
||||
gfm: true, // GitHub Flavored Markdown
|
||||
breaks: true, // Convert \n to <br>
|
||||
headerIds: true, // Add ids to headers
|
||||
mangle: false, // Don't escape HTML
|
||||
highlight: function (code: string, lang: string): string {
|
||||
// You can add syntax highlighting here if needed
|
||||
return code;
|
||||
},
|
||||
};
|
||||
|
||||
marked.setOptions(markedOptions);
|
||||
|
||||
// Basic markdown to HTML conversion with sanitization
|
||||
export default function markdownToHtml(markdown: string) {
|
||||
const rawHtml = marked.parse(markdown);
|
||||
return DOMPurify.sanitize(rawHtml as string);
|
||||
const rawHtml = marked.parse(markdown);
|
||||
return DOMPurify.sanitize(rawHtml as string);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user