Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onLongPress={() => {
const text = entities.decodeHTML(item.children[0].data)
// 长按
opts.onLongPress && opts.onLongPress(text)
// 长按显示弹窗
showActionPopover({
view: this[
'ShareNewsTagMarkParagraph' +
index +
ShareNewsTagMarkParagraphRand
],
content: text
})
}}
>
{entities.decodeHTML(item.children[0].data)}
)
})}
}
let feedUrl = normalizeUrl(feed.url);
if (!isURL(feedUrl)) {
continue;
}
let rss = await RSS.findOne({ feedUrl: feedUrl });
const limit = moment().subtract(30, 'seconds');
// don't update featured RSS feeds since that ends up removing images etc
if (!rss || (!rss.featured && limit.isAfter(rss.lastScraped))) {
let response = await RSS.findOneAndUpdate(
{ feedUrl: feedUrl },
{
categories: 'RSS',
description: entities.decodeHTML(feed.title),
feedUrl: feedUrl,
images: {
favicon: foundRSS.site.favicon,
},
lastScraped: moment().format(),
title: entities.decodeHTML(feedTitle),
url: foundRSS.site.url,
valid: true,
},
{
new: true,
rawResult: true,
upsert: true,
},
);
function lineLabelMap (dom) {
const textArray = []
dom.map(item => {
textArray.push(labelText(item))
})
return entities.decodeHTML(textArray.join(',').replace(/,/g, ''))
}
// 返回文本内容
compiledHtml = compiledHtml.replace(/{{[ ]*::([^}]+)[ ]*}}/g, function(_, expr) {
expr = entities.decodeHTML(expr);
try {
return eval("data."+expr);
} catch(e) {
console.error(" invalid expression ", expr);
}
});
text = ignore.lines(text);
text = ignore.blocks(text);
}
if (format === 'html' || format === 'markdown') {
if (format === 'markdown') {
text = md.render(text);
}
if (apiSettings.ignoreTags) {
text = ignore.tags(text, apiSettings.ignoreTags);
}
text = ignore.comments(text);
text = stripTags(text);
text = entities.decodeHTML(text);
}
text = prepareText(text, format);
const tasks = [];
const texts = splitText(text);
apiSettings.format = formatModule.getApiFormat(format);
texts.forEach(function(el, i) {
printDebug({
request: i,
format: format,
apiFormat: apiSettings.format,
lang: apiSettings.lang,
options: apiSettings.options,
exports.formatNotes = function formatNotes(notes, webApiUrlPrefix) {
const result = {
$webApiUrlPrefix: webApiUrlPrefix,
$blog: {},
posts: []
}
for (let note of notes) {
if (note.title.trim() === '_config.yml') {
let _config = note.content;
debug('_config -> %s', JSON.stringify(_config))
_config = entities.decodeHTML(enml2text(note.content))
debug('_config text -> %s', JSON.stringify(_config))
result.$blog = yaml.safeLoad(_config)
debug('$blog -> %j', result.$blog)
} else {
result.posts.push(note)
}
}
return result
}
(feed, cb) => {
let feedTitle = feed.title
if (feedTitle.toLowerCase() === "rss") {
feedTitle = feeds.site.title
}
var promise = RSS.findOneAndUpdate(
{ feedUrl: feed.url },
{
interest: featuredRSS.category,
categories: "RSS",
description: entities.decodeHTML(feed.title),
featured: false,
feedUrl: feed.url,
images: {
favicon: feeds.site.favicon,
},
lastScraped: moment().format(),
title: featuredRSS.name,
url: feeds.site.url,
valid: true,
},
{
new: true,
rawResult: true,
upsert: true,
},
)
xml2js.parseString(body, function(err, result) {
let title = result.anime.entry[0].title,
english = result.anime.entry[0].english,
ep = result.anime.entry[0].episodes,
score = result.anime.entry[0].score,
type = result.anime.entry[0].type,
status = result.anime.entry[0].status,
synopsis = result.anime.entry[0].synopsis.toString(),
id = result.anime.entry[0].id;
synopsis = ent.decodeHTML(synopsis.replace(/<br>/g, " ").replace(/\[(.{1,10})\]/g, "").replace(/\r?\n|\r/g, " ").replace(/\[(i|\/i)\]/g, "*").replace(/\[(b|\/b)\]/g, "**"));
if (!msg.channel.isPrivate && synopsis.length > 400)
synopsis = synopsis.substring(0, 400) + '...';
bot.sendMessage(msg, "**" + title + " / " + english + "**\n**Type:** " + type + " **| Episodes:** " + ep + " **| Status:** " + status + " **| Score:** " + score + "\n" + synopsis + "\n****");
});
} else bot.sendMessage(msg, "\"" + suffix + "\" not found.", function(erro, wMessage) { bot.deleteMessage(wMessage, {"wait": 8000}); });
compileMarkdown(text) {
const decodedBody = decodeHTML(text)
return marked(decodedBody, { sanitize: true })
}
}