Sha256: 4f49872a54dbc88dc957c21e9b67fadae4ef222657b52ab138b22b31d2042e45
Contents?: true
Size: 587 Bytes
Versions: 4
Compression:
Stored size: 587 Bytes
Contents
/*jslint vars: true, white: true */ /*global jQuery, IQVOC */ IQVOC.extractConcepts = function(html) { "use strict"; var $ = jQuery; // disable scripts (adapted from jQuery's `load`) var rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi; html = html.replace(rscript, ""); var concepts = $("<div />").append(html).find("ul.concepts li"); concepts = concepts.map(function(i, node) { var el = $("a", node); return { value: el.attr("href"), label: $.trim(el.text()) }; }); return concepts.length ? Array.prototype.slice.call(concepts, 0) : []; };
Version data entries
4 entries across 4 versions & 1 rubygems