Is there a way for a renderer to defer to the default behavior? #3659
-
My goal is to intercept & manipulate just a small subset of paragraph tags, ideally having the rest be handled automatically so that I don't need to figure out & handle all other types of content that can sit within paragraphs. I've read the docs and it seems like this isn't possible, but I'd like to double check:
For example, marked.use({
renderer: {
paragraph({ text }) {
if (text.startsWith('...') {
// Some custom behavior
return '...';
}
// defer to default in some form
}
}
}); |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Keep reading to the next paragraph:
Just have your custom renderer return If this isn't clear, let us know how we can improve the wording. |
Beta Was this translation helpful? Give feedback.
Keep reading to the next paragraph:
Just have your custom renderer return
false
at the point you want it to fall back to default behavior.If this isn't clear, let us know how we can improve the wording.