Exemple #1
0
    highlight: function(code, lang) {
      code = lang
          ? hljs.highlight(lang, code).value
          // since we're not using highlight.js here, we need to espace the html
          // unescape first in order to avoid double escaping
          : he.escape(he.unescape(code));

      // Allow for highlighting portions of code blocks
      // using `**` before and after
      return code.replace(/\*\*(.+)?\*\*/g, '<mark>$1</mark>');
    }
 highlight: function (code, lang) {
   // Unescape to avoid double escaping.
   code = he.unescape(code);
   return lang ? hljs.highlight(lang, code).value : he.escape(code);
 }
Exemple #3
0
		content.body.replace(/<meta[^>]*\scontent=["]([^"]*)["][^>]*(?:name|property)=["]([^"]*)["][^>]*>/gmi, function(meta, value, name) {
			let name1;
			return metas[name1 = changeCase.camelCase(name)] != null ? metas[name1] : metas[name1] = he.unescape(value);
		});
Exemple #4
0
		content.body.replace(/<title[^>]*>([^<]*)<\/title>/gmi, function(meta, title) {
			return metas.pageTitle != null ? metas.pageTitle : metas.pageTitle = he.unescape(title);
		});