mirror of
https://github.com/markedjs/marked.git
synced 2026-11-30 16:48:05 +01:00
BREAKING CHANGE:
- Default export removed. Use `import { marked } from 'marked'` or `const { marked } = require('marked')` instead.
- `/lib/marked.js` removed. Use `/marked.min.js` in script tag instead.
- When using marked in a script tag use `marked.parse(...)` instead of `marked(...)`
43 lines
503 B
JavaScript
43 lines
503 B
JavaScript
/**
|
|
* TextRenderer
|
|
* returns only the textual part of the token
|
|
*/
|
|
export class TextRenderer {
|
|
// no need for block level renderers
|
|
strong(text) {
|
|
return text;
|
|
}
|
|
|
|
em(text) {
|
|
return text;
|
|
}
|
|
|
|
codespan(text) {
|
|
return text;
|
|
}
|
|
|
|
del(text) {
|
|
return text;
|
|
}
|
|
|
|
html(text) {
|
|
return text;
|
|
}
|
|
|
|
text(text) {
|
|
return text;
|
|
}
|
|
|
|
link(href, title, text) {
|
|
return '' + text;
|
|
}
|
|
|
|
image(href, title, text) {
|
|
return '' + text;
|
|
}
|
|
|
|
br() {
|
|
return '';
|
|
}
|
|
}
|