refactor: replace command link interception with :cmd[] directive
Replace the previous mechanism of intercepting specific command-prefixed anchor tags with a dedicated `:cmd[]` markdown directive. - Implement `cmdDirective` for `marked-directive` support. - Update `CommandLinkManager` to listen for clicks on `[data-cmd]` spans instead of parsing `href` attributes. - Add CSS styles for the new `.cmd-link` class.
This commit is contained in:
@@ -7,6 +7,7 @@ import { gfmHeadingId } from "marked-gfm-heading-id";
|
||||
import markedColumns from "./columns";
|
||||
import markedCodeBlockYamlTag from "./code-block-yaml-tag";
|
||||
import { iconDirective, setIconBase } from "./icon";
|
||||
import { cmdDirective } from "./cmd";
|
||||
|
||||
// 使用 marked-directive 来支持指令语法
|
||||
const marked = new Marked()
|
||||
@@ -27,6 +28,7 @@ const marked = new Marked()
|
||||
level: "container",
|
||||
},
|
||||
iconDirective,
|
||||
cmdDirective,
|
||||
]),
|
||||
{
|
||||
extensions: [...markedColumns()],
|
||||
|
||||
Reference in New Issue
Block a user