64 questions
0
votes
1
answer
57
views
Markdown image URL encoding inconsistency
I have written the following markdown for an image:

With the intent that the output html is further processed with the url injected through a template system. So, my desired ...
0
votes
0
answers
50
views
Adding ordered list styles to markdown parser
I am using Marked.js for parsing Markdown. The original Markdown language does not support different ordered list styles, for instance, lettered ones, like HTML. I would like to introduce this ...
0
votes
0
answers
99
views
parse marked customize for list
I've seen the docs https://marked.js.org/using_pro#renderer and it has no example for the list i want to customize
more detail https://github.com/markedjs/marked/blob/master/src/Tokens.ts#L137 as the ...
1
vote
0
answers
556
views
The proper way to use marked.js with the Vue/React components
I write publications in markdown and use marked.js to display them on my blog. The blog uses custom image gallery components, audio and video players, etc. There are several simple marked.js ...
1
vote
1
answer
349
views
markedjs missing codeblock and syntax highlight
I am using merkedjs, heighlight.js and marked-heighlight for a vue markdown editor (just some project to learn the composition-api). The markdown is parsed by markedjs and code is inside a <code>...
1
vote
1
answer
1k
views
How to use highlight js with tailwind typography
I try to use tailwind typography for change HTML more beautiful but I want to highlight code syntax when it have <code> tag how can I use highlight js to highlight code block in my markdown now ...
0
votes
1
answer
241
views
marked extensions is ignored if sent renderer
simply if I used this code the extension is working fine
const originalText = '## hello world';
marked.use(gfmHeadingId());
const text = marked.parse(originalText);
console.log('text') // <h2 id=&...
0
votes
0
answers
23
views
Cannot import marked libary [duplicate]
I want to import the Marked libary but it says: Cannot find module 'node_modules/marked/lib/marked.esm.js' or its corresponding type declarations.ts(2307)
This is my Svelte code:
<script lang="...
0
votes
1
answer
1k
views
Importing 'marked' module into Angular project returns error
I have a project based on Angular 15 in which i recently added marked.
My idea was to use it for a angular pipe to transform MarkDown text to HTML.
However, there is no way i get it working, it doesn'...
1
vote
0
answers
149
views
sanitizeHtml with marked doesn't render special characters correctly (& is & and then &amp)
I'm trying to render user input using SvelteMarkdown (that uses marked).
The steps are:
user input is sanitized using sanitizeHtml
sanitized user input goes to SvelteMarkdown to be rendered in html
...
0
votes
2
answers
2k
views
marked.js not rendering image tags
When I have a markdown file with:
![[20230613_110437.jpg]]
in it, and I render it to html with
const html = marked.parse(content);
the html content just contains ![[20230613_110437.jpg]] rather than ...
0
votes
1
answer
131
views
marked: customize parser to render <h2> and following elements in <section>
How to customize marked to make it rendering <h2> tags and following elements in a <section>. If a new <h2> tag appears afterwards, wrap everything in a new <section> again.
...
3
votes
1
answer
3k
views
Error: Can't Resolve 'node_modules/marked/lib/marked.js'
I'm trying to compile my Angular app using
ng serve
The error I receive is
Error: Can't resolve 'node_modules/marked/lib/marked.js' in 'C:\ProjectName'
The error doesn't tell me what file it is ...
10
votes
3
answers
12k
views
Load file as string in vue/vite project
I have a vue/vie project in which I'm trying to read a markdown file I have into html using marked.
I attempted to use the fetch api to import it as a string, but only because I couldn't figure out ...
0
votes
1
answer
913
views
Angular 12 Error ... from Css Minimizer Error: Transform failed with 1 error: error: Invalid version: "15.2-15.3"
I know this question has been asked before, but I seem to have a slightly different problem (at least, the solution provided in similar questions don't work for me).
The project is using Angular 12, ...
3
votes
2
answers
354
views
Display GitHub Gist while rendering Markdown client-side
How can one display the contents of a GitHub Gist while parsing a markdown file client-side using Marked.js or with any other client Markdown library? The code below renders the Markdown file except ...
0
votes
1
answer
708
views
parse() is undefined using marked in Svelte app
I am trying to render some markdown in my Svelte app but am having trouble rendering with marked. I have install locally via npm and marked is present in my package.config. Also when I access marked I ...
0
votes
1
answer
478
views
Embed a URL for client-side rendering of a Markdown file
One can render a Markdown file on a static site client-side using the code below.
<div id="txt"></div>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script&...
0
votes
0
answers
378
views
Issue with options of the marked library for React
I use Marked library in a React project and would like to set the option "gfm: true" and "breaks: true".
Based on example provided on the official website I think I am doing the ...
0
votes
3
answers
11k
views
How to get only text values from a markdown string in Javascript
I currently have some code that uses marked.js to transform one big markdown string (read from a .md file) into html for display on the browser. 'md' is the markdown string and calling 'marked(md)' ...
0
votes
1
answer
253
views
Editor in Markdown Preview project not working after I downloaded 'Marked'
Trying to make a Markdown Previewer for a freeCodeCamp project. My editor was working fine, but now I can't update the markdown in my state; it's stuck on the placeholder text I wrote. Whenever I try ...
1
vote
1
answer
2k
views
Marked does not render code snippet and table correctly
Markdown file
---
title: 'Testing Second Blog Post'
date: 'May 2 2022'
excerpt: 'This is the excerpt'
cover_image: '/images/posts/test.jpeg'
---
# Basics of Markdown
Markdown is the most popular ...
5
votes
4
answers
31k
views
error TS2307: Cannot find module 'marked' or its corresponding type declarations
I was performing a headless test in Cypress and had to run
npm install --save-dev start-server-and-test so the server can start and wait for the url to respond before running the test. And ever since ...
0
votes
2
answers
3k
views
Marked library in Vue 3 throwing marked__WEBPACK_IMPORTED_MODULE_0__.default error
I want to render markdown in my component, which usually can be done with the marked library which can be installed like so:
yarn add marked
and used in a component like so:
<template>
<...
0
votes
1
answer
522
views
How to have more instances of marked js in one project?
My problem, which I cannot overcome is that I cannot achieve a state where I have 2 parallel instances oh markedjs which work fully independently in terms of configuration I am passing through.
In ...
0
votes
2
answers
1k
views
How to store use triple-quoted backtick strings with marked.js
I'm using marked.js to render code that we want to store (ultimately as JSON). However, the I can't get triple-back-ticked convention to render correctly. I'm sure user error on my part but how would ...
0
votes
1
answer
542
views
Convert markdown linked .md to .html
I am using marked cli to convert my markdown file to html file.
I want to convert hyper linked markdown file (.md) to (.html)
Current output:
$ echo "[test](./doc/test.md)" | marked
<p>...
11
votes
2
answers
9k
views
Marked is not a function
I'm trying to build a markdown previewer using react and the marked node package. Everything works up to when I try to parse any markdown on the DOM. When I do I get an error message: Uncaught ...
1
vote
1
answer
4k
views
How to use marked plugins in Vue3 project?
I have tried to use marked plugin in my Vue.js apps.
Installed [email protected], compiled is nothing problem.
But in browser, any contents showed.
I used vite to make Vue project.
Also, I referred this ...
5
votes
1
answer
9k
views
Client-side rendering of a Markdown file
One can follow the Marked library documentation and render a Markdown string inline. This is a working code snippet.
<div id="content"></div>
<script src="https://cdn.jsdelivr.net/...
0
votes
2
answers
2k
views
Using the marked library - TypeError: marked.parse is not a function
I am buiding a simple markdown previewer in JS
I have:
Installed the library by running npm i marked in the app folder (I double checked the nodes_package folder and a marked folder was indeed ...
0
votes
1
answer
545
views
ReferenceError: Can't find variable: marked
I am using React and Marked for a markdown previewer in Codepen.io. Here's a link to my project and JavaScript code:
https://codepen.io/lengvarskyj/pen/bGrrqeg
const initialState = `
# Heading 1
## ...
5
votes
2
answers
2k
views
Markdown styles not getting loaded in Nuxt + Vue project
I am working on a Vue + Nuxt + Tailwind project and using the marked library to convert a text into markdown.
The issue is that some styles like "Headings" and "Link" are loading ...
0
votes
0
answers
32
views
How do I add an online module/library to my React file? [duplicate]
I'm working with React on VS Code after loading the template with
npx create-react-app app
I'm trying to add a CDN Marked 2.1.3
but I don't know where to put it. Normally with regular html, css, ...
1
vote
2
answers
429
views
FCC Markdown Previewer project failing on load test
I'm trying to pass a Freecodecamp project. The project is a markdown previewer where you can enter code in a textarea and it renders it on the webpage. I have all the tests passing except two. It ...
0
votes
2
answers
922
views
marked with gfm: true not rendering tables with appropriate css
I'm having these options to configure my marked object but the tables are not getting rendered with proper css.
{
gfm: true,
tables: true,
breaks: false,
pedantic: ...
14
votes
3
answers
20k
views
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 ...
0
votes
1
answer
831
views
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 ...
0
votes
1
answer
139
views
Pug, Marked and NodeJs issue
I have a question regarding Node, Pug and Marked. I have one, specific place where I'll be adding reports and I'd like them to have simple formatting (bold, links etc).
It seems that everything is ...
0
votes
3
answers
566
views
return result of async function in synchronous function
I am implementing a custom render function for marked which will check a few conditions on images, does an async request and then returns an image from a different source. However, since the new ...
4
votes
4
answers
4k
views
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, '...
9
votes
1
answer
2k
views
What are the downsides of using a simple regex-based markdown parser? [closed]
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 ...
3
votes
2
answers
3k
views
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 ...
1
vote
1
answer
705
views
how to remove bullet points from tasks rendered by marked.js
i'm using the marked.js library to parse input from a textarea into html .
in markdown a task syntax is written like this : - [x] done task or - [ ] not done task .
result after parsing :
<ul>...
8
votes
1
answer
5k
views
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:
<!doctype html>
<html>
<head>
&...
12
votes
1
answer
9k
views
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(...
3
votes
2
answers
807
views
How to transform link in markdown() to link with favicon using Google S2 Converter?
I'd like markdown links to have a favicon within the transformed link.
https://www.google.com/s2/favicons?domain=http://cnn.com
- will return the favicon from any domain.
Marked (https://github.com/...
1
vote
0
answers
46
views
Pagedown app always converts first line at <code> tag?
I added script for converting text to markdown display. Added "content-markdown" class to my div of content but my first line of the text always is being surrounded by <pre> and <code> ...
0
votes
0
answers
28
views
A security-patch was committed, but not yet version-bumped to NPM. options?
A XSS vulnerability was fixed in the marked library, with no new version yet bumped to npm. What are my options here to update my application with this fix (i.e. applying the fix, without manually ...
3
votes
2
answers
3k
views
Marked for react-native [closed]
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 ...