HTML styles in the LocalInspection tooltips
已回答
Hi all, I have following html code in the html tooltip
<html>
<body>
<table style="border-collapse: collapse; width: 100%;" border="1">
<tbody>
<tr>
<td style="width: 100%;"><span style="font-size: 18pt;"><span style="font-family: Arial;"><span style="color: #000000;"><strong>ruleIdShortDescriptionText</strong></span></span></span><img src="https://img.icons8.com/?size=2x&id=G_CJ8xWqKGEC&format=png" alt="" style="float: right;" width="60" height="60" /></td>
</tr>
<tr>
<td style="width: 100%;"><span style="font-size: 16pt;"><span style="font-family: Arial;"><span style="color: #000000;">messageText</span></span></span></td>
</tr>
<tr>
<td style="width: 100%;">ruleIDText</td>
</tr>
</tbody>
</table>
</body>
</html>
And on the website picture align is right, but on intellij align isn't working and picture placed right near the text.
Is it possible to solve it on some way?
请先登录再写评论。
Hi,
Inspection tooltip content is rendered with
javax.swing.JEditorPane. Do not expect exactly the same results as in modern browsers.What is the reason for so complex HTML formatting of inspection messages? They should be simple, see: https://jetbrains.design/intellij/text/inspections/
Applying so complex formatting and layout will make your plugin inconsistent with other IDE plugins and features, which will result in bad UX. See: https://plugins.jetbrains.com/docs/intellij/plugin-user-experience.html#consistent-and-good-looking-ui