git ssb

1+

Daan Patchwork / patchwork



Commit 58ab0241031aa549a35cce1e678c27065ae66221

make standard happy.

Daan Wynen committed on 5/3/2020, 8:29:00 PM
Parent: 5c0503d31e5896ec0f2c0f801dbaa6adb981fc8f

Files changed

lib/depject/profile/html/preview.jschanged
lib/markdownSummary.jschanged
lib/depject/profile/html/preview.jsView
@@ -49,10 +49,8 @@
4949 ]),
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 })]
5856 )
@@ -107,33 +105,8 @@
107105 ])
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 }
139112
lib/markdownSummary.jsView
@@ -10,9 +10,9 @@
1010 text = module.exports.truncate(text, max)
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 }
1818 return text

Built with git-ssb-web