Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit 52ea11c

Browse files
make standard happy.
1 parent 8df4f45 commit 52ea11c

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

lib/depject/profile/html/preview.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ exports.create = function (api) {
5050
h(
5151
'section -profile', [
5252
computed(description, (description) => {
53-
// const txt = removeMd(description)
54-
// const summary = shortenDescription(txt, idLen)
5553
const summary = titleFromMarkdown(description, idLen, 1)
5654
return summary
5755
})]
@@ -108,31 +106,6 @@ exports.create = function (api) {
108106
])
109107
})
110108

111-
function shortenDescription (txt, len) {
112-
if (txt == null) {
113-
return ''
114-
}
115-
const line1 = txt.trim().split('\n', 1)[0]
116-
if (line1.length <= len) {
117-
return line1
118-
}
119-
const words = line1.split(' ')
120-
let result = words.shift()
121-
if (result.length > len) {
122-
return result.splice(0, len - 1) + ' …'
123-
}
124-
for (let i = 0; i < len; i++) {
125-
const currentWord = words.shift()
126-
// + 1 for the joining space, and +2 for the final ellipsis
127-
if (result.length + 1 + currentWord.length + 2 <= len) {
128-
result += ` ${currentWord}`
129-
} else {
130-
break
131-
}
132-
}
133-
return result + ' …'
134-
}
135-
136109
function displayMutualFriends (profiles) {
137110
api.sheet.profiles(profiles, i18n('Mutual Friends'))
138111
}

lib/markdownSummary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ exports.titleFromMarkdown = (text, max, maxLines) => {
1111
return text
1212
}
1313

14-
exports.truncate = (text, maxLength) => {
14+
exports.truncate = (text, maxLength) => {
1515
if (text.length > maxLength) {
1616
text = text.substring(0, maxLength - 2) + '...'
1717
}

0 commit comments

Comments
 (0)