Skip to content

Commit

Permalink
MarkdownFormatter renamed and now static
Browse files Browse the repository at this point in the history
  • Loading branch information
mulla028 committed Dec 14, 2024
1 parent a4bace7 commit da853b1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import jakarta.inject.Inject;

public class SummaryShowingComponent extends VBox {
private static final MarkdownFormatter MARKDOWN_FORMATTER = new MarkdownFormatter();
@FXML private Text summaryInfoText;
@FXML private CheckBox markdownCheckbox;

Expand All @@ -29,7 +30,6 @@ public class SummaryShowingComponent extends VBox {
private WebView contentWebView;
private final Summary summary;
private final Runnable regenerateCallback;
private final MarkdownFormatter markdownFormatter = new MarkdownFormatter();

public SummaryShowingComponent(Summary summary, Runnable regenerateCallback) {
this.summary = summary;
Expand Down Expand Up @@ -59,10 +59,10 @@ private void initializeWebView() {
private void updateContent(boolean isMarkdown) {
String content = summary.content();
if (isMarkdown) {
contentWebView.getEngine().loadContent(markdownFormatter.format(content));
contentWebView.getEngine().loadContent(MARKDOWN_FORMATTER.format(content));
} else {
contentWebView.getEngine().loadContent(
"<body style='margin: 0; padding: 0; width: 100vw'>" +
"<body style='margin: 0; padding: 5px; width: 100vw'>" +
"<div style='white-space: pre-wrap; word-wrap: break-word; width: 100vw'>" +
content +
"</div></body>"
Expand Down

0 comments on commit da853b1

Please sign in to comment.