mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
don't add "page-xxx-" class if trailing slash exists
This commit is contained in:
@@ -98,7 +98,7 @@ module.exports = function(middleware) {
|
||||
};
|
||||
|
||||
function buildBodyClass(req) {
|
||||
var clean = req.path.replace(/^\/api/, '').replace(/^\//, '');
|
||||
var clean = req.path.replace(/^\/api/, '').replace(/^\/|\/$/g, '');
|
||||
var parts = clean.split('/').slice(0, 3);
|
||||
parts.forEach(function(p, index) {
|
||||
parts[index] = index ? parts[0] + '-' + p : 'page-' + (p || 'home');
|
||||
|
||||
Reference in New Issue
Block a user