How to use the stripTags function from underscore.string

Find comprehensive JavaScript underscore.string.stripTags code examples handpicked from public code repositorys.

23
24
25
26
27
28
29
30
31
32
);

const body = marked(content);
const title = meta.title ? meta.title : contentProcessors.slugToTitle(slug);
const excerpt = _s.prune(
  _s.stripTags(_s.unescapeHTML(body)),
  config.excerpt_length || 400
);

return {
fork icon449
star icon0
watch icon0

387
388
389
390
391
392
393
394
395
396
397
398
399
    'use strict';


    let result = txt;


    result = result.replace(/<br\s*[/]?>/gi, brShrink ? ' ' : '\n'); // Заменяем <br> на \n или ничего
    result = _s.stripTags(result); // Убираем обрамляющие тэги ahref
    result = _s.unescapeHTML(result); // Возвращаем эскейпленные


    return result;
};
fork icon14
star icon70
watch icon0

+ 6 other calls in file

13
14
15
16
17
18
19
20
21
22

// Skip if Search not present
if (!req.query.search) { return next(); }

// remove < and >
var tagFreeQuery   = _s.stripTags(req.query.search);

// remove /, ', " and & from query
var invalidChars   = '&\'"/';
var sanitizedQuery = validator.blacklist(tagFreeQuery, invalidChars);
fork icon0
star icon1
watch icon0

14
15
16
17
18
19
20
21
22
23

// Skip if Search not present
if (!req.query.search) { return next(); }

// remove < and >
var rawQuery   = _s.stripTags(req.query.search);
var sanitizedQuery = sanitize(rawQuery);

// Using try/catch seems broken
var searchResults = [];
fork icon0
star icon0
watch icon0