mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-14 02:05:47 +00:00
20 lines
444 B
JavaScript
20 lines
444 B
JavaScript
![]() |
import CodeMirror from "codemirror";
|
||
|
import "codemirror/lib/codemirror.css";
|
||
|
|
||
|
const HTMLEditor = () => {
|
||
|
const allHTMLEditors = document.querySelectorAll(
|
||
|
"textarea[data-editor='html']"
|
||
|
);
|
||
|
|
||
|
for (let j = 0; j < allHTMLEditors.length; j++) {
|
||
|
const textarea = allHTMLEditors[j];
|
||
|
|
||
|
CodeMirror.fromTextArea(textarea, {
|
||
|
lineNumbers: true,
|
||
|
mode: { name: "xml", htmlMode: true },
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
|
||
|
export default HTMLEditor;
|