-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
help wantedExtra attention is neededExtra attention is needed
Description
marked@5 deprecated some options.
safe-marked approach is a wrapper of marked.
However, marked limit the this approach.
In the future, safe-marked user can not extends marked.
It is possible to continue using the WRAPPER approach, but it will be dirty code.
// ugly approach
import { createMarkdown } from "safe-marked";
const markdown = createMarkdown({
marked: (marked) => {
// extends marked
marked.use(someExtension);
return {
// options
}
}
});
const html = markdown(`# Header
This is [CommonMark](https://commonmark.org/) text.
`);
console.log(html); So, We need to move this sanitizer function to marked extension like markedSanitizer
e.g.
import { marked } from "marked";
import { markedSanitizer } from "marked-sanitizer";
marked.use(markedSanitizer());As a result, we will deprecate safe-marked.
TODO
- create? or find? sanitizer extension for marked
- deprecated
safe-markedand recommened to use the extension- As possible, provide migration tool
If you have any opinions, please feel free to write to us.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed