Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

53
Vistas
Rendering .md files in html using marked.js

I am trying to render a markdown file (.md) in a <body> component of an html page. I came across marked.js.

The documentation presents the following usage:

marked.parse('# Marked in the browser\n\nRendered by **marked**.');

Which works well for what I want to do (it renders the markdown in html format). However, I'd like the input into the marked.parse call to be a .md file such that I don't have to write all of the content between simple quote barriers.

I tried:

marked.parse(src='file.md');

and

marked.parse('href=file.md');

but this didn't work.

Any advice?

8 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos