本文整理匯總了TypeScript中vs/base/common/htmlContent.removeMarkdownEscapes函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript removeMarkdownEscapes函數的具體用法?TypeScript removeMarkdownEscapes怎麽用?TypeScript removeMarkdownEscapes使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了removeMarkdownEscapes函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: removeMarkdownEscapes
renderer.link = (href, title, text): string => {
// Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829
if (href === text) { // raw link case
text = removeMarkdownEscapes(text);
}
href = _href(href);
title = removeMarkdownEscapes(title);
href = removeMarkdownEscapes(href);
if (
!href
|| href.match(/^data:|javascript:/i)
|| (href.match(/^command:/i) && !markdown.isTrusted)
|| href.match(/^command:(\/\/\/)?_workbench\.downloadResource/i)
) {
// drop the link
return text;
} else {
// HTML Encode href
href = href.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
.replace(/'/g, ''');
return `<a href="#" data-href="${href}" title="${title || href}">${text}</a>`;
}
};
示例2: removeMarkdownEscapes
renderer.link = (href, title, text): string => {
// Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829
if (href === text) { // raw link case
text = removeMarkdownEscapes(text);
}
title = removeMarkdownEscapes(title);
href = removeMarkdownEscapes(href);
return `<a href="#" data-href="${href}" title="${title || text}">${text}</a>`;
};
示例3: removeMarkdownEscapes
renderer.link = (href, title, text): string => {
// Remove markdown escapes. Workaround for https://github.com/chjj/marked/issues/829
if (href === text) { // raw link case
text = removeMarkdownEscapes(text);
}
title = removeMarkdownEscapes(title);
href = removeMarkdownEscapes(href);
if (
!href
|| href.match(/^data:|javascript:/i)
|| (href.match(/^command:/i) && !markdown.isTrusted)
) {
// drop the link
return text;
} else {
return `<a href="#" data-href="${href}" title="${title || href}">${text}</a>`;
}
};