Confira a página de demonstração para ver o marcado em ação ⛹️
Nossas páginas de documentação também são renderizadas usando a marcação ?
Leia também sobre:
Node.js: apenas as versões atuais e LTS do Node.js são suportadas. As versões do Node.js em fim de vida útil podem se tornar incompatíveis com o Marked a qualquer momento.
Navegador: Não IE11 :)
CLI:
npm install -g marked
No 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 >
ou importe o 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 >
Direitos autorais (c) 2011-2022, Christopher Jeffrey. (Licença MIT)