Add rule for wordpress seo plugin (fixes #132)

This commit is contained in:
MattIPv4 2020-06-02 17:35:32 +01:00
parent 9465e8a2fb
commit 8921cd711f
2 changed files with 6 additions and 1 deletions

View file

@ -32,6 +32,9 @@ export default global => {
deny: 'all',
};
config['# WordPress: SEO plugin'] = '';
config['location ~* ^/wp-content/plugins/wordpress-seo(?:-premium)?/css/main-sitemap\\.xsl$'] = {};
config['# WordPress: deny wp-content/plugins (except earlier rules)'] = '';
config['location ~ ^/wp-content/plugins'] = {
deny: 'all',

View file

@ -107,7 +107,9 @@ export default entriesOrObject => {
// Single linebreak between comment and block
.replace(/^([^\S\r\n]*#.*)(?:\n[^\S\r\n]*)+\n([^\S\r\n]*.*{)/gm, '$1\n$2')
// Double linebreak after double comment
.replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2');
.replace(/^([^\S\r\n]*#.*\n[^\S\r\n]*#.*\n)([^\S\r\n]*[^#\s])/gm, '$1\n$2')
// No newline for empty blocks
.replace(/^([^\S\r\n]*.*{)\n[^\S\r\n]*(})/gm, '$1$2');
// Cleanup extra linebreaks between multiple close blocks
// Use a loop as this has overlapping matches