| ... | ... | @@ -2835,16 +2835,20 @@ var zigAnalysis; |
| 2835 | 2835 | |
| 2836 | 2836 | function shortDescMarkdown(docs) { |
| 2837 | 2837 | const trimmed_docs = docs.trim(); |
| 2838 | | let index = trimmed_docs.indexOf("."); |
| 2839 | | if (index < 0) { |
| 2840 | | index = trimmed_docs.indexOf("\n"); |
| 2841 | | if (index < 0) { |
| 2842 | | index = trimmed_docs.length; |
| 2843 | | } |
| 2844 | | } else { |
| 2845 | | index += 1; // include the period |
| 2838 | let index = trimmed_docs.indexOf("\n\n"); |
| 2839 | let cut = false; |
| 2840 | |
| 2841 | if (index < 0 || index > 80) { |
| 2842 | if (trimmed_docs.length > 80) { |
| 2843 | index = 80; |
| 2844 | cut = true; |
| 2845 | } else { |
| 2846 | index = trimmed_docs.length; |
| 2847 | } |
| 2846 | 2848 | } |
| 2847 | | const slice = trimmed_docs.slice(0, index); |
| 2849 | |
| 2850 | let slice = trimmed_docs.slice(0, index); |
| 2851 | if (cut) slice += "..."; |
| 2848 | 2852 | return markdown(slice); |
| 2849 | 2853 | } |
| 2850 | 2854 | |