mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Reduce highlights class names.
This commit is contained in:
@@ -21,6 +21,22 @@ function build(type) {
|
|||||||
$header = $('h1').first().remove(),
|
$header = $('h1').first().remove(),
|
||||||
version = _.trim($header.find('span').first().text()).slice(1);
|
version = _.trim($header.find('span').first().text()).slice(1);
|
||||||
|
|
||||||
|
var highlights = [
|
||||||
|
'comment',
|
||||||
|
'constant',
|
||||||
|
'delimiter',
|
||||||
|
'html',
|
||||||
|
'js',
|
||||||
|
'method',
|
||||||
|
'modifier',
|
||||||
|
'numeric',
|
||||||
|
'shell',
|
||||||
|
'source',
|
||||||
|
'string',
|
||||||
|
'text',
|
||||||
|
'type'
|
||||||
|
];
|
||||||
|
|
||||||
// Remove docdown horizontal rules.
|
// Remove docdown horizontal rules.
|
||||||
$('hr').remove();
|
$('hr').remove();
|
||||||
|
|
||||||
@@ -51,6 +67,14 @@ function build(type) {
|
|||||||
$code.html($code.html().replace(/<\/?em>/g, '_'));
|
$code.html($code.html().replace(/<\/?em>/g, '_'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Cleanup highlights class names.
|
||||||
|
$('.highlight [class]').each(function() {
|
||||||
|
var $el = $(this),
|
||||||
|
className = _.intersection($el.attr('class').split(/\s+/), highlights).join(' ');
|
||||||
|
|
||||||
|
$el.attr('class', className || null);
|
||||||
|
});
|
||||||
|
|
||||||
var html = [
|
var html = [
|
||||||
// Append YAML front matter.
|
// Append YAML front matter.
|
||||||
'---',
|
'---',
|
||||||
|
|||||||
Reference in New Issue
Block a user