mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
Add setting to display underscores as spaces in tags
This commit is contained in:
@ -2,6 +2,9 @@
|
||||
|
||||
const markdown = require('./markdown.js');
|
||||
const uri = require('./uri.js');
|
||||
const settings = require('../models/settings.js');
|
||||
|
||||
const tagUnderscoresAsSpaces = settings.get().tagUnderscoresAsSpaces;
|
||||
|
||||
function decamelize(str, sep) {
|
||||
sep = sep === undefined ? '-' : sep;
|
||||
@ -197,6 +200,13 @@ function dataURItoBlob(dataURI) {
|
||||
return new Blob([data], {type: mimeString});
|
||||
}
|
||||
|
||||
function getPrettyTagName(tag) {
|
||||
if (tagUnderscoresAsSpaces) {
|
||||
return tag.replace(/_/g, " ");
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
range: range,
|
||||
formatRelativeTime: formatRelativeTime,
|
||||
@ -214,4 +224,5 @@ module.exports = {
|
||||
decamelize: decamelize,
|
||||
escapeSearchTerm: escapeSearchTerm,
|
||||
dataURItoBlob: dataURItoBlob,
|
||||
getPrettyTagName: getPrettyTagName,
|
||||
};
|
||||
|
Reference in New Issue
Block a user