Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
71 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export const mathRenderAdapter = { | ||
getCode: (mathElement: Element) => mathElement.textContent, | ||
getMathElements: (element: HTMLElement) => element.querySelectorAll(".language-math"), | ||
}; | ||
export const mermaidRenderAdapter = { | ||
/** 不仅要返回code,并且需要将 code 设置为 el 的 innerHTML */ | ||
getCode: (el: Element) => el.textContent, | ||
getMathElements: (element: HTMLElement) => element.querySelectorAll(".language-mermaid"), | ||
}; | ||
export const mindmapRenderAdapter = { | ||
getCode: (el: Element) => el.getAttribute("data-code"), | ||
getMathElements: (el: HTMLElement | Document) => el.querySelectorAll(".language-mindmap"), | ||
}; | ||
export const chartRenderAdapter = { | ||
getCode: (el: Element) => el.innerHTML, | ||
getMathElements: (el: HTMLElement | Document) => el.querySelectorAll(".language-echarts"), | ||
}; | ||
export const abcRenderAdapter = { | ||
getCode: (el: Element) => el.textContent, | ||
getMathElements: (el: HTMLElement | Document) => el.querySelectorAll(".language-abc"), | ||
}; | ||
export const graphvizRenderAdapter = { | ||
getCode: (el: Element) => el.textContent, | ||
getMathElements: (el: HTMLElement | Document) => el.querySelectorAll(".language-graphviz"), | ||
}; | ||
export const flowchartRenderAdapter = { | ||
getCode: (el: Element) => el.textContent, | ||
getMathElements: (el: HTMLElement | Document) => el.querySelectorAll(".language-flowchart"), | ||
}; | ||
export const plantumlRenderAdapter = { | ||
getCode: (el: Element) => el.textContent, | ||
getMathElements: (el: HTMLElement | Document) => el.querySelectorAll(".language-plantuml"), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters