本文整理汇总了TypeScript中striptags.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: testStriptags
function testStriptags() {
var html =
'<a href="https://example.com">' +
'lorem ipsum <strong>dolor</strong> <em>sit</em> amet' +
'</a>';
striptags(html);
striptags(html, '<a><strong>');
striptags(html, ['a']);
}
开发者ID:1drop,项目名称:DefinitelyTyped,代码行数:10,代码来源:striptags-tests.ts
示例2: reject
let promise = new Promise<nodemailer.SentMessageInfo>((resolve, reject) => {
const from = 'CSG Pro <[email protected]>';
const to = email;
if (!html) {
if (!url) {
reject(new Error('URL Not Provided'));
return;
}
html = `
As promised, here is the link to download the file you requested.<br>
<br>
<a href="${url}">${url}</a>
<br>
`;
}
let text = striptags(html);
mailer.sendMail({ to, from, subject, html, text }, (err, info) => {
if (err) {
reject(err);
} else {
resolve(info);
}
});
});
开发者ID:csgpro,项目名称:csgpro.com,代码行数:28,代码来源:mail.commands.ts
示例3: Error
user.generatePasswordResetToken().then(token => {
if (!token || typeof token !== 'string') {
throw new Error('Error Generating Token');
}
let protocol = getProtocolByHost(host);
let resetURL = `${protocol}://${host}/admin/reset-password/${token}`;
let to = user.getDataValue('email');
let from = 'CSG Notification <[email protected]>';
let subject = 'Password Reset Request';
let html = `Hi ${user.getDataValue('firstName')},<br>
<br>
I received a request to reset your password. If this was you, you may reset your password by clicking the link below.<br>
<br>
For your safety, the link will expire in 48 hours.<br>
<br>
${resetURL}<br>
<br>
If this wasn't you, please disregard this email.<br>
<br>
${frankSignature}
`;
let text = striptags(html);
mailer.sendMail({ to, from, subject, html, text }, (err, info) => {
if (err) {
reject(err);
} else {
resolve(info);
}
});
}).catch(e => reject(e));
开发者ID:csgpro,项目名称:csgpro.com,代码行数:31,代码来源:user.commands.ts
示例4: striptags
let promise = new Promise<nodemailer.SentMessageInfo>((resolve, reject) => {
const from = 'CSG Notification <[email protected]>';
const to = process.env.CONTACT_FORM_EMAIL;
let html = `
${formData.name} submitted the contact form from csgpro.com.<br>
<br>
Here's what they said:<br>
<br>
<b>Name</b><br>
${formData.name}<br>
<br>
<b>Company</b><br>
${formData.company || 'Not Provided'}<br>
<br>
<b>Phone</b><br>
${formData.phone || 'Not Provided'}<br>
<br>
<b>Email Address</b><br>
${formData.email || 'Not Provided'}<br>
<br>
<b>What they need</b><br>
${formData.note}<br>
<br>
${frankSignature}
`;
let text = striptags(html);
mailer.sendMail({ to, from, subject, html, text }, (err, info) => {
if (err) {
reject(err);
} else {
resolve(info);
}
});
});
开发者ID:csgpro,项目名称:csgpro.com,代码行数:38,代码来源:mail.commands.ts
示例5: generateSnippet
export function generateSnippet(text: string): string {
return striptags(text.substr(0, 600)).substr(0, 250);
}
开发者ID:ifiske,项目名称:iFiske,代码行数:3,代码来源:util.ts
注:本文中的striptags.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论