Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Sep 14, 2016
1 parent 8840048 commit e0ced1d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const summary = await summaly('http://elephant.2chblog.jp/archives/52025138.html
console.log(summary); // will be ... โ†“
/*
{
title: 'ใƒขใƒ๏ผฐใ€Œใ‚ใ‚Šใ™ใจ่จ€ใˆใฐใŠๆผใ‚‰ใ—ใ€‚ใŠๆผใ‚‰ใ—ใจ่จ€ใˆใฐใ‚ใ‚Šใ™ใ€ : ใ‚จใƒฌใƒ•ใ‚กใƒณใƒˆ้€Ÿๅ ฑ๏ผšSSใพใจใ‚ใƒ–ใƒญใ‚ฐ',
title: 'ใƒขใƒ๏ผฐใ€Œใ‚ใ‚Šใ™ใจ่จ€ใˆใฐใŠๆผใ‚‰ใ—ใ€‚ใŠๆผใ‚‰ใ—ใจ่จ€ใˆใฐใ‚ใ‚Šใ™ใ€',
icon: 'http://livedoor.blogimg.jp/tmg24news/imgs/9/5/favicon.ico',
description: '1๏ผšไปฅไธ‹ใ€ๅ็„กใ—ใซใ‹ใ‚ใ‚Šใพใ—ใฆVIPใŒใŠ้€ใ‚Šใ—ใพใ™๏ผš2013/03/30(ๅœŸ) 14:57:29.09 ID:An34eOmY0ใƒขใƒ๏ผฐใ€Œๅ่ซ–ใŒ ใ‚ใ‚‹ใ‚„ใคใ‚‚ใ„ใ‚‹ใ‹ใ‚‚ใ—ใ‚Œใชใ„ใ€ ใƒขใƒ๏ผฐใ€Œใ ใŒไฟบใฎไธปๅผตใ‚‚่žใ„ใฆใปใ—ใ„๏ผใ€€ใŠๆผใ‚‰ใ—ใ•ใ›ใ‚‹ใชใ‚‰ใ‚ใ‚Šใ™ใŒไธ€็•ชใ ๏ผใ€ ๆ—ฅ่œๅญใ€Œใ‚€ใตใตโ€ฆโ€ฆใ„ใใชใ‚Šใใ‚“ใชใ“ใจใ‚’ๅคงๅฃฐใง',
thumbnail: 'http://livedoor.blogimg.jp/tmg24news/imgs/8/d/8df6e1a0-s.jpg',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "summaly",
"version": "1.1.0",
"version": "1.1.1",
"description": "Get web page's summary",
"author": "syuilo <i@syuilo.com>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/general.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default async (url: URL.Url): Promise<any> => {

icon = icon ? URL.resolve(url.href, icon) : null;

title = title.replace(new RegExp(`[\-\|:]?${escapeRegExp(siteName)}$`));
title = title.replace(new RegExp(`\s?[\-\|:]?\s?${escapeRegExp(siteName)}$`), '').trim();

return {
title: title,
Expand Down

0 comments on commit e0ced1d

Please sign in to comment.