Cannot set `marked` options
See original GitHub issueI’d like to set custom options as shown in the marked documentation e.g.:
marked.setOptions({
breaks: false
});
Which makes single line breaks into <br>
s instead of the normal md behaviour of just adding a space (i.e. treating this as a line continuation).
Right now, I can hack this by just adding my desired call to setOptions
at the top of markdown.component.js
, but would prefer to have an option per component instance.
Any plans to add setting of custom marked options? Happy to help with preparing a PR with an attempt if this is useful.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
setOptions - Marked Documentation
Called when markdownString has been parsed. Can be used as second argument if no options present. Alternative using reference. // Create reference instance ......
Read more >Renderer not merged when used in marked() options #2082
After looking at the source code, it does not seem like the renderer is "merged into" anything when passed directly to marked() ....
Read more >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...
Read more >marked
String of markdown source to be compiled. options. Type: object. Hash of options. Can also be set using the marked.setOptions method as seen...
Read more >marked/README.md - UNPKG
1, # marked. 2. 3, > A full-featured markdown parser and compiler, written in JavaScript. Built. 4, > for speed. 5. 6, [![...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi guys, I like your ideas and where this is heading!
I started a PR for v1.5 to expose the renderer and allow marked options to be specified when loading the module.
This will be a step forward to add the
markedOptions
as an input binding for the component, which would allow to override the options set on the module for a specific instance when provided (more flexibility).I only have to fix JavaScript transpile process with rollup + update the
readme.md
and I’ll do the release somewhere early next week.Closing for now but feel free to reopen if you feel v1.5.0 does not provide what you need.