authorgravatar for 37453713+ominitay@users.noreply.github.comominitay <37453713+ominitay@users.noreply.github.com> 2022-08-23 18:42:46+01:00
committergravatar for 37453713+ominitay@users.noreply.github.comominitay <37453713+ominitay@users.noreply.github.com> 2022-08-23 19:26:54+01:00
logb63667dda33aa8b2f9aafd5923f8c3b9034e90db
tree2538766741b8c01fd0b770868a703c3b82f22664
parent583175dc1d8d14bc92838476eb226f0e91077abc
signaturelock-open Commit is signed but in an unrecognized format.

autodocs: improve first-line descriptions


1 files changed, 13 insertions(+), 9 deletions(-)

lib/docs/main.js+13-9
......@@ -2835,16 +2835,20 @@ var zigAnalysis;
28352835
28362836 function shortDescMarkdown(docs) {
28372837 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 }
28462848 }
2847 const slice = trimmed_docs.slice(0, index);
2849
2850 let slice = trimmed_docs.slice(0, index);
2851 if (cut) slice += "...";
28482852 return markdown(slice);
28492853 }
28502854