Questions tagged [javascript-marked]

Use this tag for any question related to open source `marked` project

A full-featured markdown parser and compiler, written in JavaScript. Built for speed.

More info on github

32 questions
10
votes
5 answers

Convert between Markdown elements

What are the options to parse Markdown document and process its elements to output an another Markdown document? Let's say it ``` # unaffected # ``` # H1 # H1 == ## H2 ## H2 -- ### H3 ### should be converted to ``` # unaffected # ``` ## H1…
Estus Flask
  • 150,909
  • 47
  • 291
  • 441
9
votes
1 answer

returning rendered markdown with express and marked

So I am running a small test application to return the contents of a markdown file in html when a route is visited. I am using marked to render the markdown (https://github.com/chjj/marked). Here us what I have so far - app.get('/test',…
salxander
  • 1,001
  • 5
  • 19
  • 28
7
votes
3 answers

use marked in Angular2

I'm trying to make a simple Markdown inline editor with Angular2. I tryed several approaches but none seems to work. I installed marked with npm and it is now visible in the projects node_modules directory. I can import it and it is recognized by…
Yannick Widmer
  • 984
  • 11
  • 25
5
votes
1 answer

markedjs table has no styles

I am using the markedjs markdown parser on my website, but the table syntax didn't style the right way (no borders and stripes). My code: Marked in the browser
neifnei
  • 75
  • 8
5
votes
1 answer

How to use npm Marked with HighlightJS

How do you use npm Marked with HighlightJS? I'm trying to automate my docs to be parsed and styled. Looking at the following example from marked docs: // Using async version of marked marked(markdownString, function (err, content) { if (err) throw…
jtlindsey
  • 2,466
  • 1
  • 22
  • 46
4
votes
4 answers

Vue.js markdown filter

I'm using Evan You's example of how to convert HTML to markdown - https://jsfiddle.net/yyx990803/oe7axeab/. Installing the marked package through npm and then implementing this leads to the error, 'marked' is not defined. If I include the cdn link…
wilcode
  • 627
  • 2
  • 9
  • 24
4
votes
1 answer

What are the downsides of using a simple regex-based markdown parser?

I require a relatively simple markdown parser for my application. Just simple stuff like bolding, italics, etc. I was looking around for libraries and many seem to be quite large. For example, marked is quite popular with 20,000 stars. And it's…
Ryan Peschel
  • 9,095
  • 18
  • 57
  • 101
4
votes
1 answer

Passing module function to a function in another file

I'm not exactly sure what's going on here, but it has been bugging me for a while. The marked node markdown parser works like this: var marked = require('marked'); marked.setOptions({ mathjax : false }); That all works. But I'm building a plugin…
Ronze
  • 1,464
  • 2
  • 15
  • 33
4
votes
3 answers

Marked ( Markdown ) + Mermaid ( Flow Chart & Diagrams )

Struggling to get Mermaid - https://github.com/knsv/mermaid to work with Marked - https://github.com/chjj/marked From what I gather I should be able to write the following in markdown ``` graph TD;A-->B;A-->C;B-->D;C-->D; ``` and have it…
Andrew Vink
  • 251
  • 1
  • 3
  • 7
3
votes
3 answers

Material-UI styles and html / markdown

Our application is build using Material-UI library (with themes). As part of this app we are parsing markdown to html (marked library). How can you apply material-ui themes ( Typography ) to a pure html ? Somehow
ic3
  • 7,231
  • 8
  • 55
  • 101
3
votes
2 answers

How do I override marked.js ul element?

I'm using marked.js through nunjucks-markdown to render markdown in a node/express app. The markdown content is being rendered fine, however, I want to set default classes on the ul element. By default it comes through as:
    but I'd like to…
Codesight
  • 305
  • 2
  • 11
3
votes
1 answer

Marked for react-native

I am fetching strings with markdown from api and trying to use them in react-native project. Is there any similar library to marked that can be used in react-native or what is the best practice to achieve same result?
matejs
  • 133
  • 2
  • 15
2
votes
1 answer

How can I get marked to render tables without adding CSS?

I am using marked which supports github flavored markdown. This includes table support: var marked = require('marked'); var markdown = ` | API | Documented CSP Policy | | ------------- |:-------------:| |Google Fonts|No documented…
mikemaccana
  • 81,787
  • 73
  • 317
  • 396
2
votes
1 answer

Marked throwing errors (Markdown) - Meteor

So I've been trying to get some type of markdown plugin for converting the markdown syntax into html but I am having lots of trouble. I am using meteor, however, I am not sure if that's really an issue. I've tried the following plugin called: Marked…
user1952811
  • 2,278
  • 5
  • 25
  • 45
1
vote
1 answer

How to update markdown content

I'm using marked.js to create posts using markdown. The posts are created successfully with markdown and the html is being displayed however when I update / edit posts, sanitizedHtml is not being updated, it still contains the old content. The other…
Rahni
  • 451
  • 6
  • 20
1
2 3