refactor: migrate shiki to core API with dynamic language/theme loading
- Update code block regex to support symbols/numbers in language identifiers - Adjust codespan background color to a softer shade
This commit is contained in:
parent
6372dfc41f
commit
3e96007f1f
3 changed files with 24 additions and 14 deletions
|
|
@ -24,7 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||
SOFTWARE. */
|
||||
|
||||
import c from "chalk";
|
||||
import type { BundledLanguage, BundledTheme, HighlighterGeneric } from "shiki";
|
||||
import type { BundledLanguage, BundledTheme, HighlighterCore } from "shiki";
|
||||
|
||||
// From @shikijs/vscode-textmate
|
||||
enum FontStyle {
|
||||
|
|
@ -37,7 +37,7 @@ enum FontStyle {
|
|||
}
|
||||
|
||||
export function codeToANSI(
|
||||
highlighter: HighlighterGeneric<BundledLanguage, BundledTheme>,
|
||||
highlighter: HighlighterCore,
|
||||
code: string,
|
||||
lang: BundledLanguage,
|
||||
theme: BundledTheme,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue