(
valueList: string | string[],
alignRight: boolean,
valueCloseToMarker: boolean,
style: string
)
| 446 | } |
| 447 | |
| 448 | function wrapInlineValueHTML( |
| 449 | valueList: string | string[], |
| 450 | alignRight: boolean, |
| 451 | valueCloseToMarker: boolean, |
| 452 | style: string |
| 453 | ): string { |
| 454 | // Do not too close to marker, considering there are multiple values separated by spaces. |
| 455 | const paddingStr = valueCloseToMarker ? '10px' : '20px'; |
| 456 | const alignCSS = alignRight ? `float:right;margin-left:${paddingStr}` : ''; |
| 457 | valueList = isArray(valueList) ? valueList : [valueList]; |
| 458 | return ( |
| 459 | `<span style="${alignCSS};${style}">` |
| 460 | // Value has commas inside, so use ' ' as delimiter for multiple values. |
| 461 | + map(valueList, value => encodeHTML(value)).join(' ') |
| 462 | + '</span>' |
| 463 | ); |
| 464 | } |
| 465 | |
| 466 | function wrapInlineNameRichText(ctx: TooltipMarkupBuildContext, name: string, style: RichTextStyle): string { |
| 467 | return ctx.markupStyleCreator.wrapRichTextStyle(name, style as Dictionary<unknown>); |
no test coverage detected