Skip to content

Commit c2c7d52

Browse files
authored
Merge pull request #68 from cameron-toy/mdfix
markdown wrap fix
2 parents 105108c + e22e9b1 commit c2c7d52

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/widget.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ const EDITABLE_WIDGET_CLASS = 'pr-EditableWidget';
4242

4343
const IN_DRAG_CLASS = 'pr-InDrag';
4444

45+
const MARKDOWN_OUTPUT_CLASS = 'pr-MarkdownOutput';
46+
4547
/**
4648
* Widget to wrap delete/move/etc functionality of widgets in a dashboard (future).
4749
*/
@@ -90,10 +92,12 @@ export class DashboardWidget extends Widget {
9092
void this._notebook.context.ready.then(() => {
9193
let clone: Widget;
9294
const cellType = cell.model.type;
95+
const container = document.createElement('div');
9396

9497
switch (cellType) {
9598
case 'markdown':
9699
clone = (cell as MarkdownCell).clone().editorWidget.parent;
100+
container.classList.add(MARKDOWN_OUTPUT_CLASS);
97101
break;
98102
case 'code':
99103
clone = (cell as CodeCell).cloneOutputArea();
@@ -105,7 +109,6 @@ export class DashboardWidget extends Widget {
105109
// Make widget invisible until it's properly loaded/sized.
106110
this.node.style.opacity = '0';
107111

108-
const container = document.createElement('div');
109112
container.classList.add(DASHBOARD_WIDGET_CHILD_CLASS);
110113
container.appendChild(clone.node);
111114
this.node.appendChild(container);

style/index.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,15 @@
6363
display: inline-block;
6464
}
6565

66+
.pr-DashboardWidgetChild.pr-MarkdownOutput {
67+
flex-grow: 1;
68+
}
69+
6670
.pr-EditableWidget:hover .pr-Resizer {
6771
display: block;
6872
}
6973

74+
7075
.pr-Canvas {
7176
pointer-events: none;
7277
}

0 commit comments

Comments
 (0)