How to use the @remirror/core-extensions.ParagraphExtension function in @remirror/core-extensions

To help you get started, we’ve selected a few @remirror/core-extensions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ifiokjr / remirror / @remirror / react-renderer / src / __tests__ / react-serializer.spec.tsx View on Github external
test('ReactSerializer.fromExtensionManager', () => {
  expect(serializer).toBeInstanceOf(ReactSerializer);
  expect(serializer.nodes.paragraph).toBeFunction();
  expect(serializer.marks.bold).toBeFunction();

  // fills in for a missing text
  const altExtensions = [
    { extension: new DocExtension(), priority: 2 },
    { extension: new ParagraphExtension(), priority: 2 },
    { extension: new TextExtension(), priority: 2 },
    { extension: new BoldExtension(), priority: 2 },
    { extension: new CodeBlockExtension(), priority: 2 },
  ];
  const altManager = ExtensionManager.create(altExtensions);
  expect(ReactSerializer.fromExtensionManager(altManager).nodes.text).toBeFunction();
});
github ifiokjr / remirror / @remirror / test-fixtures / src / schema-helpers.ts View on Github external
UnderlineExtension,
} from '@remirror/core-extensions';
import { PortalContainer } from '@remirror/react-portals';
import { defaultRemirrorThemeValue } from '@remirror/ui';
import minDocument from 'min-document';

export const helpers = {
  getState: Cast(jest.fn()),
  portalContainer: new PortalContainer(),
  getTheme: () => defaultRemirrorThemeValue,
};

export const baseExtensions = [
  { extension: new DocExtension(), priority: 2 },
  { extension: new TextExtension(), priority: 2 },
  { extension: new ParagraphExtension(), priority: 2 },
];

export const extensions = [
  ...baseExtensions,
  { extension: new HistoryExtension(), priority: 2 },
  { extension: new PlaceholderExtension(), priority: 2 },
  { extension: new BoldExtension(), priority: 3 },
  { extension: new ItalicExtension(), priority: 3 },
  { extension: new UnderlineExtension(), priority: 3 },
  { extension: new BlockquoteExtension(), priority: 3 },
];

/**
 * Useful for testing
 */
export const ExtensionMap = {