tangled
alpha
login
or
join now
leaflet.pub
/
leaflet
289
fork
atom
a tool for shared writing and social publishing
289
fork
atom
overview
issues
29
pulls
pipelines
add key to mapped text fragment
awarm.space
6 months ago
b3403a37
7e0b2bb4
+3
-3
1 changed file
expand all
collapse all
unified
split
components
Blocks
TextBlock
RenderYJSFragment.tsx
+3
-3
components/Blocks/TextBlock/RenderYJSFragment.tsx
···
1
1
import { Doc, applyUpdate, XmlElement, XmlHook, XmlText } from "yjs";
2
2
import { nodes, marks } from "prosemirror-schema-basic";
3
3
-
import { CSSProperties } from "react";
3
3
+
import { CSSProperties, Fragment } from "react";
4
4
import { theme } from "tailwind.config";
5
5
import * as base64 from "base64-js";
6
6
···
34
34
let deltas = node.toDelta() as Delta[];
35
35
if (deltas.length === 0) return <br />;
36
36
return (
37
37
-
<>
37
37
+
<Fragment key={index}>
38
38
{deltas.map((d, index) => {
39
39
if (d.attributes?.link)
40
40
return (
···
56
56
</span>
57
57
);
58
58
})}
59
59
-
</>
59
59
+
</Fragment>
60
60
);
61
61
}
62
62