erossini / BlazorMarkdownEditor

Complete Markdown Editor component for Blazor WebAssembly and Blazor Server. Full of functionalities
https://www.puresourcecode.com/dotnet/blazor/markdown-editor-component-for-blazor/
MIT License
139 stars 20 forks source link

Highlight.js can not render code #49

Open iamSmallY opened 1 week ago

iamSmallY commented 1 week ago

I tried the version 8.0.5 and find out that Highlight.js can not render code. I have looked up the source code and find here. It looks like only the lang is code will call highlight function, but hljs.getLanguage('code') ? lang : 'plaintext' is always plaintext. So maybe we need to place the highlighting judgment at the end like

// all other judgment
else if (hljsInstalled) {
    const language = hljs.getLanguage(lang) ? lang : 'plaintext';
    return hljs.highlight(code, { language }).value;
}

Also, can we let the user customize the renderingConfig