Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function markedOptionsFactory(router: Router): MarkedOptions {
const renderer = new MarkedRenderer();
renderer.blockquote = (quote: string) => {
return `<blockquote class="note default">${quote}</blockquote>`
};
renderer.heading = (text: string, level: number) => {
const escapedText = text.toLowerCase()
.replace(/[^\w():]+/g, '-')
.replace(/-code-/g, '-')
.replace(/-strong-/g, '')
.replace(/-$/, '')
.replace(/^-/, '')
.replace(/\([a-zA-Z: ]*\)$/, '');
const currentUrl = router.routerState.snapshot.url.split('#')[0].substr(1);
return level >= 4
export function markedOptions(): MarkedOptions {
const renderer = new MarkedRenderer();
renderer.blockquote = (text: string) => {
return '<blockquote class="blockquote"><p>' + text + '</p></blockquote>';
};
return {
renderer: renderer,
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false,
};
}
useFactory: (): MarkedOptions => {
return {
renderer: new MarkedRenderer(),
gfm: true,
tables: true,
breaks: false,
pedantic: false,
sanitize: false,
smartLists: true,
smartypants: false,
};
},
}),