(text)
| 16 | } |
| 17 | |
| 18 | function startAndEnd(text) { |
| 19 | var words = text.split(/\W+/); |
| 20 | if (!words[0]) words.shift(); |
| 21 | if (!words[words.length - 1]) words.pop(); |
| 22 | if (words.length <= 6) return words.join(" "); |
| 23 | return words.slice(0, 3).concat(words.slice(words.length - 3)).join(" "); |
| 24 | } |
| 25 | |
| 26 | function tokenText(token) { |
| 27 | if (token.type == "text" || token.type == "code_inline") return token.content |