How to use the entities.decodeHTML function in entities

To help you get started, we’ve selected a few entities examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github orzhtml / react-native-orzhtml-htmlview / example / HTMLView / htmlToElement.js View on Github external
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)}
                      
                    
                  )
                })}
github GetStream / Winds / api / src / controllers / rss.js View on Github external
}

		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,
				},
			);
github orzhtml / react-native-orzhtml-htmlview / example / HTMLView / htmlToElement.js View on Github external
function lineLabelMap (dom) {
    const textArray = []
    dom.map(item => {
      textArray.push(labelText(item))
    })
    return entities.decodeHTML(textArray.join(',').replace(/,/g, ''))
  }
  // 返回文本内容
github allenhwkim / angular-template / compilers / expression.js View on Github external
compiledHtml = compiledHtml.replace(/{{[ ]*::([^}]+)[ ]*}}/g, function(_, expr) {
    expr = entities.decodeHTML(expr);
    try {
      return  eval("data."+expr);
    } catch(e) {
      console.error(" invalid expression ", expr);
    }
  });
github hcodes / yaspeller / lib / yaspeller.js View on Github external
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,
github everblogjs / everblog / lib / utils.js View on Github external
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
}
github GetStream / Winds / api / src / commands / load-featured-feeds.js View on Github external
(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,
                                },
                            )
github brussell98 / Mirai / bot / commands.js View on Github external
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 &amp;&amp; synopsis.length &gt; 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}); });
github Angarsk8 / Loopa-News / client / src / components / CommentItem.vue View on Github external
compileMarkdown(text) {
      const decodedBody = decodeHTML(text)
      return marked(decodedBody, { sanitize: true })
    }
  }