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