Skip to content

Commit

Permalink
Trim leading and trailing whitespaces from title and description
Browse files Browse the repository at this point in the history
  • Loading branch information
saket committed Oct 21, 2023
1 parent d860bb3 commit bf6436a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ internal class HtmlMetadataParser(private val logger: UnfurlLogger) {
fun parse(url: HttpUrl, document: Document): UnfurlResult {
return UnfurlResult(
url = url,
title = parseTitle(document),
description = parseDescription(document),
title = parseTitle(document)?.trim(),
description = parseDescription(document)?.trim(),
favicon = parseFaviconUrl(document) ?: fallbackFaviconUrl(url),
thumbnail = parseThumbnailUrl(document)
)
Expand Down

0 comments on commit bf6436a

Please sign in to comment.