Consulte la página de demostración para ver el marcado en acción ⛹️
Nuestras páginas de documentación también se representan usando?
Lea también sobre:
Node.js: solo se admiten las versiones actuales y LTS de Node.js. Las versiones de Node.js al final de su vida útil pueden volverse incompatibles con Marked en cualquier momento.
Navegador: No IE11 :)
CLI:
npm install -g marked
En el navegador:
npm install marked
DOMPurify.sanitize(marked.parse(`<img src="x" onerror="alert('not happening')">`));
CLI
# Example with stdin input
$ marked -o hello.html
hello world
^D
$ cat hello.html
< p > hello world < /p >
# Print all options
$ marked --help
Navegador
<!doctype html >
< html >
< head >
< meta charset =" utf-8 "/>
< title > Marked in the browser </ title >
</ head >
< body >
< div id =" content " > </ div >
< script src =" https://cdn.jsdelivr.net/npm/marked/marked.min.js " > </ script >
< script >
document . getElementById ( 'content' ) . innerHTML =
marked . parse ( '# Marked in the browsernnRendered by **marked**.' ) ;
</ script >
</ body >
</ html >
o importar el módulo esm
< script type =" module " >
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js" ;
document . getElementById ( 'content' ) . innerHTML =
marked . parse ( '# Marked in the browsernnRendered by **marked**.' ) ;
</ script >
Copyright (c) 2011-2022, Christopher Jeffrey. (Licencia MIT)