mirror of
https://gitlab.com/PronounsPage/PronounsPage.git
synced 2025-09-27 15:05:38 -04:00
don't remove quotes in <head>
This commit is contained in:
parent
a0afec37f6
commit
41c242dc86
@ -23,7 +23,7 @@ export const head = ({title, description, banner}) => {
|
|||||||
const meta = { meta: [] };
|
const meta = { meta: [] };
|
||||||
|
|
||||||
if (title) {
|
if (title) {
|
||||||
title = clearLinkedText(title);
|
title = clearLinkedText(title, false);
|
||||||
title += ' • ' + process.env.TITLE;
|
title += ' • ' + process.env.TITLE;
|
||||||
meta.title = title;
|
meta.title = title;
|
||||||
meta.meta.push({ hid: 'og:title', property: 'og:title', content: title });
|
meta.meta.push({ hid: 'og:title', property: 'og:title', content: title });
|
||||||
@ -198,12 +198,16 @@ export const handleErrorAsync = func => (req, res, next) => {
|
|||||||
func(req, res, next).catch((error) => next(error));
|
func(req, res, next).catch((error) => next(error));
|
||||||
};
|
};
|
||||||
|
|
||||||
export const clearLinkedText = (text) => {
|
export const clearLinkedText = (text, quotes = true) => {
|
||||||
return text
|
text = text
|
||||||
.replace(/{[^}=]+=([^}=]+)}/g, '$1')
|
.replace(/{[^}=]+=([^}=]+)}/g, '$1')
|
||||||
.replace(/{([^}=]+)}/g, '$1')
|
.replace(/{([^}=]+)}/g, '$1');
|
||||||
.replace(/[„”"']/g, '')
|
|
||||||
;
|
if (quotes) {
|
||||||
|
text = text.replace(/[„”"']/g, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const sortClearedLinkedText = (items, key) => {
|
export const sortClearedLinkedText = (items, key) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user