json-joy
Version:
Collection of libraries for building collaborative editing apps.
12 lines • 472 B
JavaScript
import { usePeritext } from '../context';
import { Char } from '../../constants';
export const AnchorView = (props) => {
const { plugins } = usePeritext();
// This zero-width non-breaking space prevents word wrapping at position where
// anchor is inserted.
let children = Char.ZeroLengthSpace;
for (const plugin of plugins)
children = plugin.anchor?.(props, children) ?? children;
return children;
};
//# sourceMappingURL=AnchorView.js.map