Skip to content

Commit

Permalink
IDEA-140909 Display an empty line between P tags in the javadoc renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
JB-Dmitry committed Jun 8, 2015
1 parent a4bcd91 commit 138911c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public Object getData(@NonNls String dataId) {
myText = "";
myEditorPane.setEditable(false);
myEditorPane.setBackground(HintUtil.INFORMATION_COLOR);
myEditorPane.setEditorKit(UIUtil.getHTMLEditorKit());
myEditorPane.setEditorKit(UIUtil.getHTMLEditorKit(false));
myScrollPane = new JBScrollPane(myEditorPane) {
@Override
protected void processMouseWheelEvent(MouseWheelEvent e) {
Expand Down
9 changes: 8 additions & 1 deletion platform/util/src/com/intellij/util/ui/UIUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -2230,11 +2230,18 @@ public static StyleSheet loadStyleSheet(@Nullable URL url) {
}

public static HTMLEditorKit getHTMLEditorKit() {
return getHTMLEditorKit(true);
}

public static HTMLEditorKit getHTMLEditorKit(boolean noGapsBetweenParagraphs) {
Font font = getLabelFont();
@NonNls String family = !SystemInfo.isWindows && font != null ? font.getFamily() : "Tahoma";
int size = font != null ? font.getSize() : 11;

final String customCss = String.format("body, div, p { font-family: %s; font-size: %s; } p { margin-top: 0; }", family, size);
String customCss = String.format("body, div, p { font-family: %s; font-size: %s; }", family, size);
if (noGapsBetweenParagraphs) {
customCss += " p { margin-top: 0; }";
}

final StyleSheet style = new StyleSheet();
style.addStyleSheet(isUnderDarcula() ? (StyleSheet)UIManager.getDefaults().get("StyledEditorKit.JBDefaultStyle") : DEFAULT_HTML_KIT_CSS);
Expand Down

0 comments on commit 138911c

Please sign in to comment.