52cee2eff9e953d4584a415b8a9b84bd2326d3cd braney Tue Aug 18 11:14:37 2026 -0700 hgTables: encode track menu and schema text consistently, refs #38123 diff --git src/hg/hgTables/bigBed.c src/hg/hgTables/bigBed.c index 3a9ac5e07d4..df23211aa47 100644 --- src/hg/hgTables/bigBed.c +++ src/hg/hgTables/bigBed.c @@ -10,30 +10,31 @@ #include "localmem.h" #include "jksql.h" #include "cheapcgi.h" #include "cart.h" #include "web.h" #include "bed.h" #include "hdb.h" #include "trackDb.h" #include "obscure.h" #include "hmmstats.h" #include "correlate.h" #include "asParse.h" #include "bbiFile.h" #include "bigBed.h" #include "hubConnect.h" +#include "htmshell.h" #include "asFilter.h" #include "hgTables.h" #include "trackHub.h" #include "chromAlias.h" #include "bPlusTree.h" #include "errCatch.h" boolean isBigBed(char *database, char *table, struct trackDb *parent, struct customTrack *(*ctLookupName)(char *table)) /* Local test to see if something is big bed. Handles hub tracks unlike hIsBigBed. */ { struct trackDb *tdb = hashFindVal(fullTableToTdbHash, table); // if "table" is explicitly listed, we're going to use that instead of any bigDataUrl @@ -536,80 +537,81 @@ hPrintf("Database: %s", trackHubSkipHubName(database)); hPrintf("    Primary Table: %s ", table); printf("Data last updated: %s
\n", firstWordInLine(sqlUnixTimeToDate(&timep, FALSE))); printDownloadLink("Big Bed", tdb, fileName); if (bbi->version >= 2) { hPrintf("
Item Count: "); printLongWithCommas(stdout, bigBedItemCount(bbi)); } printTypeHelpDesc(tdb->type); printTableBrowserLink(tdb, table); hPrintf("
\n"); -hPrintf("Format description: %s
", as->comment); +// the autoSql comes from the hub's data file when this is a hub track +hPrintf("Format description: %s
", hubEncode(tdb, as->comment)); /* Put up table that describes fields. */ hTableStart(); hPrintf("field"); if (ivList != NULL) hPrintf("example"); hPrintf("description "); puts("\n"); struct asColumn *col; int colCount = 0; char *row[bbi->fieldCount]; char startBuf[16], endBuf[16]; if (ivList != NULL) { char *dupeRest = lmCloneString(lm, ivList->rest); /* Manage rest-stomping side-effect */ bigBedIntervalToRow(ivList, chromList->name, startBuf, endBuf, row, bbi->fieldCount); ivList->rest = dupeRest; } for (col = as->columnList; col != NULL; col = col->next) { - hPrintf("%s", col->name); + hPrintf("%s", hubEncode(tdb, col->name)); if (ivList != NULL) - hPrintf("%s", row[colCount]); - hPrintf("%s", col->comment); + hPrintf("%s", hubEncode(tdb, row[colCount])); + hPrintf("%s", hubEncode(tdb, col->comment)); ++colCount; } /* If more fields than descriptions put up minimally helpful info (at least has example). */ for ( ; colCount < bbi->fieldCount; ++colCount) { hPrintf("column%d", colCount+1); if (ivList != NULL) - hPrintf("%s", row[colCount]); + hPrintf("%s", hubEncode(tdb, row[colCount])); hPrintf("n/a\n"); } hTableEnd(); if (ivList != NULL) { /* Put up another section with sample rows. */ webNewSection("Sample Rows"); hTableStart(); /* Print field names as column headers for example */ hPrintf(""); int colIx = 0; for (col = as->columnList; col != NULL; col = col->next) { - hPrintf("%s", col->name); + hPrintf("%s", hubEncode(tdb, col->name)); ++colIx; } for (; colIx < colCount; ++colIx) hPrintf("column%d", colIx+1); hPrintf("\n"); /* Print sample lines. */ struct bigBedInterval *iv; for (iv=ivList; iv != NULL; iv = iv->next) { bigBedIntervalToRow(iv, chromList->name, startBuf, endBuf, row, bbi->fieldCount); hPrintf(""); for (colIx=0; colIx