-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove deprecated options (#2936)
BREAKING CHANGE: deprecated options removed. See https://marked.js.org/using_advanced#options to see how to enable the removed options with extensions.
- Loading branch information
Showing
63 changed files
with
341 additions
and
2,474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,10 +13,7 @@ import { marked } from 'marked'; | |
marked.use({ | ||
pedantic: false, | ||
gfm: true, | ||
breaks: false, | ||
sanitize: false, | ||
smartypants: false, | ||
xhtml: false | ||
breaks: false | ||
}); | ||
``` | ||
|
||
|
@@ -249,25 +246,9 @@ console.log(marked.parse('$ latex code $\n\n` other code `')); | |
- <code>**codespan**(*string* src)</code> | ||
- <code>**br**(*string* src)</code> | ||
- <code>**del**(*string* src)</code> | ||
- <code>**autolink**(*string* src, *function* mangle)</code> | ||
- <code>**url**(*string* src, *function* mangle)</code> | ||
- <code>**inlineText**(*string* src, *function* smartypants)</code> | ||
|
||
`mangle` is a method that changes text to HTML character references: | ||
|
||
```js | ||
mangle('[email protected]') | ||
// "test@example.com" | ||
``` | ||
|
||
`smartypants` is a method that translates plain ASCII punctuation characters into “smart” typographic punctuation HTML entities: | ||
|
||
https://daringfireball.net/projects/smartypants/ | ||
|
||
```js | ||
smartypants('"this ... string"') | ||
// "“this … string”" | ||
``` | ||
- <code>**autolink**(*string* src)</code> | ||
- <code>**url**(*string* src)</code> | ||
- <code>**inlineText**(*string* src)</code> | ||
|
||
*** | ||
|
||
|
@@ -337,17 +318,18 @@ marked.use({ hooks: { preprocess } }); | |
// Run marked | ||
console.log(marked.parse(` | ||
--- | ||
headerIds: false | ||
breaks: true | ||
--- | ||
## test | ||
line1 | ||
line2 | ||
`.trim())); | ||
``` | ||
|
||
**Output:** | ||
|
||
```html | ||
<h2>test</h2> | ||
<p>line1<br>line2</p> | ||
``` | ||
|
||
**Example:** Sanitize HTML with [isomorphic-dompurify](https://www.npmjs.com/package/isomorphic-dompurify) | ||
|
Oops, something went wrong.
22ebdb2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
marked-website – ./
marked-website-git-master-markedjs.vercel.app
marked-website-markedjs.vercel.app
marked.js.org
markedjs.vercel.app