-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add math plugin * Add KaTeX engine to sample
- Loading branch information
1 parent
f86bd0c
commit 0037055
Showing
5 changed files
with
79 additions
and
3 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
margin: 20px auto; | ||
} | ||
</style> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css"> | ||
</head> | ||
<body> | ||
<h2>CKEditor 5 – edit</h2> | ||
|
@@ -24,6 +25,13 @@ <h2>CKEditor 5 – view</h2> | |
<mark class="marker-yellow">editor</mark> | ||
</div> | ||
|
||
<h2>Formula rendering from markup</h2> | ||
<div id="formulas"> | ||
<span class="math-tex">\(x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}\)</span> | ||
</div> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/contrib/auto-render.min.js"></script> | ||
<script src="../build/ckeditor.js"></script> | ||
<script> | ||
console.log( | ||
|
@@ -34,6 +42,9 @@ <h2>CKEditor 5 – view</h2> | |
console.error(error); | ||
} | ||
); | ||
|
||
const preview = document.getElementById('formulas'); | ||
renderMathInElement(preview); | ||
</script> | ||
</body> | ||
</html> |
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