This commit is contained in:
syuilo 2016-09-15 03:55:30 +09:00
parent e0ced1dce9
commit c981350893
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{
"name": "summaly",
"version": "1.1.1",
"version": "1.1.2",
"description": "Get web page's summary",
"author": "syuilo <i@syuilo.com>",
"license": "MIT",

View File

@ -75,7 +75,12 @@ export default async (url: URL.Url): Promise<any> => {
icon = icon ? URL.resolve(url.href, icon) : null;
title = title.replace(new RegExp(`\s?[\-\|:]?\s?${escapeRegExp(siteName)}$`), '').trim();
title = title.replace(new RegExp(`${escapeRegExp(siteName)}$`), '').trim();
title = title.replace(/[\-\|:]$/, '').trim();
if (title == '') {
title = siteName;
}
return {
title: title,