2e75814ac8468bdfb14d01cabe7455b63154a64b kent Thu Feb 10 16:59:09 2011 -0800 Adding example lines to BAM schema page in table browser. Pushing forward on getting identifiers to work there, but still a ways to go. (It no longer bombs at the paste identifiers page, but it does shortly thereafter.) diff --git src/hg/hgTables/hgTables.c src/hg/hgTables/hgTables.c index f8bddb3..822c1b6 100644 --- src/hg/hgTables/hgTables.c +++ src/hg/hgTables/hgTables.c @@ -107,51 +107,46 @@ if (*s == '>') ++s; /* skip closing bracket > */ c = *s++; /* next char after the closing bracket > */ } else c = 0; /* no closing bracket > found, end of string */ } *e++ = c; /* copies all text outside tags, including ending NULL */ } } void writeHtmlCell(char *text) /* Write out a cell in an HTML table, making text not too big, * and stripping html tags and breaking spaces.... */ { int maxLen = 128; -if (strlen(text) > maxLen) +int len = strlen(text); +char *extra = ""; +if (len > maxLen) { - char *s = cloneStringZ(text,maxLen); + len = maxLen; + extra = " ..."; + } +char *s = cloneStringZ(text,len); char *r; stripHtmlTags(s); eraseTrailingSpaces(s); r = replaceChars(s, " ", " "); - hPrintf("%s ...", r); +hPrintf("%s%s", r, extra); freeMem(s); freeMem(r); } -else - { - char *r; - stripHtmlTags(text); - eraseTrailingSpaces(text); - r = replaceChars(text, " ", " "); - hPrintf("%s", r); - freeMem(r); - } -} static void vaHtmlOpen(char *format, va_list args) /* Start up a page that will be in html format. */ { puts("Content-Type:text/html\n"); cartVaWebStart(cart, database, format, args); } void htmlOpen(char *format, ...) /* Start up a page that will be in html format. */ { va_list args; va_start(args, format); vaHtmlOpen(format, args); }