Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/editors/slate/elements/hr/index.tsx
1702 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { register, SlateElement } from "../register";
7
8
export interface HR extends SlateElement {
9
type: "hr";
10
}
11
12
register({
13
slateType: "hr",
14
15
toSlate: ({ children }) => {
16
return { type: "hr", isVoid: true, children };
17
},
18
19
StaticElement: ({ attributes }) => {
20
// The borderTop on the hr is just "fighting back" against a dumb thing
21
// that is imposed by bootstrap3... (it's in scaffolding.less). Someday
22
// we'll get rid of bootstrap css entirely!
23
return <hr {...attributes} style={{ borderTop: "1px solid #aaa" }} />;
24
},
25
});
26
27