<commit_before>// @flow
/**
 * Most of this was stolen from https://github.com/ianstormtaylor/slate/blob/460498b5ddfcecee7439eafe4f4d31cacde69f41/examples/markdown-preview/index.js
 */
import React from 'react';
import decorate from './decorator';

type Options = {
  sizes?: Array<string>,
};

const MarkdownPlugin = (options: Options = {}) => {
  const sizes = options.sizes || ['2.441em', '1.953em', '1.563em', '1.25em'];

  return {
    schema: {
      marks: {
        title: (props: any) => {
          const { attributes, children, mark: { data } } = props;
          const level = data.get('level');
          const fontSize = (level && sizes[level - 1]) || '1em';
          return (
            <span<commit_msg>Make it easy to add default size to headings<commit_after>// @flow
/**
 * Most of this was stolen from https://github.com/ianstormtaylor/slate/blob/460498b5ddfcecee7439eafe4f4d31cacde69f41/examples/markdown-preview/index.js
 */
import React from 'react';
import decorate from './decorator';

type Options = {
  sizes?: Array<string>,
};

const MarkdownPlugin = (options: Options = {}) => {
  const sizes = options.sizes || [
    '2.441em',
    '1.953em',
    '1.563em',
    '1.25em',
    '1em',
  ];

  return {
    schema: {
      marks: {
        title: (props: any) => {
          const { attributes, children, mark: { data } } = props;
          const level = data.get('level');
          const fontSize =
            (level && sizes[level - 1]) || sizes[sizes.length - 1];
          return (
            <span
{'fraction_non_alphanumeric': 0.1563517915309446, 'fraction_numerical': 0.04755700325732899, 'mean_word_length': 2.588785046728972, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '50898', 'n_tokens_mistral': 548, 'n_tokens_neox': 508, 'n_words': 119}