4c756ae28c7c8a654ba4a8877224f03513999b64 chmalee Tue May 19 14:16:27 2026 -0700 More fixes from code review. Hopefully have cleared the last remaining vestiges of the first version of the tooltip implementation, refs #37528 diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index 53efc363a7e..ffc44a57987 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -1097,36 +1097,39 @@ return FALSE; */ if (!isWithCenterLabels(track)) return FALSE; if (theImgBox) return TRUE; if (isCenterLabelConditionallySeen(track)) return TRUE; return FALSE; } void mapStatusMessage(char *format, ...) /* Write out stuff that will cause a status message to * appear when the mouse is over this box. */ { -va_list(args); +va_list args; va_start(args, format); -hPrintf(" TITLE=\""); -hvPrintf(format, args); -hPutc('"'); +struct dyString *dy = dyStringNew(0); +dyStringVaPrintf(dy, format, args); va_end(args); +char *encoded = attributeEncode(dy->string); +hPrintf(" TITLE=\"%s\" data-tooltip=\"%s\"", encoded, encoded); +freeMem(encoded); +dyStringFree(&dy); } void mapBoxReinvoke(struct hvGfx *hvg, int x, int y, int width, int height, struct track *track, boolean toggle, char *chrom, long start, long end, char *message, char *extra) /* Print out image map rectangle that would invoke this program again. * If track is non-NULL then put that track's id in the map item. * if toggle is true, then toggle track between full and dense. * If chrom is non-null then jump to chrom:start-end. * Add extra string to the URL if it's not NULL */ { struct dyString *ui = uiStateUrlPart(toggle ? track : NULL); struct dyString *id = dyStringNew(0); if(track) dyStringPrintf(id, " id='%s'", track->track);