8000 Add non breaking space: Space() · electrikmilk/javascript-ui@e7e3f18 · GitHub
[go: up one dir, main page]

Skip 8000 to content

Commit e7e3f18

Browse files
committed
Add non breaking space: Space()
1 parent 49a7325 commit e7e3f18

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/elements/Spacer.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44

55
import {Element} from '../element.js';
66

7+
export function Space() {
8+
return new NonBreakingSpace();
9+
}
10+
11+
class NonBreakingSpace extends Element {
12+
constructor() {
13+
const element = document.createTextNode(' ');
14+
super(element);
15+
this.element = element;
16+
}
17+
}
18+
719
export function Spacer(times = 1) {
820
return new BreakTag(times);
921
}

0 commit comments

Comments
 (0)
0