Repository: mui/material-ui
File: docs/src/modules/utils/generateMarkdown.ts (TypeScript)

Code before:

function generateProps(reactAPI: ReactApi) {
  const header = '## Props';

  let text = `${header}

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|\n`;

  Object.keys(reactAPI.props).forEach((propRaw) => {
    const prop = reactAPI.props[propRaw];

    if (typeof prop.description === 'undefined') {
      throw new Error(`The "${propRaw}" prop is missing a description`);
    }

    const description = generatePropDescription(prop);

    if (description === null) {
      return;
    }

    const renderedDefaultValue = prop.defaultValue?.value.replace(/\r*\n/g, '');
    const renderDefaultValue =
      renderedDefaultValue &&
      // Ignore "large" default values which would break the table layout.
      renderedDefaultValue.length <= 150;

    let defaultValueColumn = '';
    if (renderDefaultValue) {
      defaultValueColumn = `<span class="prop-default">${escapeCell(
        // narrowed `renderedDefaultValue` to non-nullable by `renderDefaultValue`
        renderedDefaultValue!,
      )}</span>`;
    }

    const chainedPropType = getChained(prop.type);

    if (
      prop.required ||
      /\.isRequired/.test(prop.type.raw) ||
      (chainedPropType !== false && chainedPropType.required)
    ) {
      propRaw = `<span class="prop-name required">${propRaw}<abbr title="required">*</abbr></span>`;
    } else {
      propRaw = `<span class="prop-name">${propRaw}</span>`;
    }

    if (prop.type.name === 'custom') {
      if (getDeprecatedInfo(prop.type)) {
        propRaw = `~~${propRaw}~~`;

Review comment (suggestion):
Petty grammar change:

```suggestion
      // Ignore "large" default values that would break the table layout.
```

Code after:

function generateProps(reactAPI: ReactApi) {
  const header = '## Props';

  let text = `${header}

| Name | Type | Default | Description |
|:-----|:-----|:--------|:------------|\n`;

  Object.keys(reactAPI.props).forEach((propRaw) => {
    const prop = reactAPI.props[propRaw];

    if (typeof prop.description === 'undefined') {
      throw new Error(`The "${propRaw}" prop is missing a description`);
    }

    const description = generatePropDescription(prop);

    if (description === null) {
      return;
    }

    const renderedDefaultValue = prop.defaultValue?.value.replace(/\r*\n/g, '');
    const renderDefaultValue =
      renderedDefaultValue &&
      // Ignore "large" default values that would break the table layout.
      renderedDefaultValue.length <= 150;

    let defaultValueColumn = '';
    if (renderDefaultValue) {
      defaultValueColumn = `<span class="prop-default">${escapeCell(
        // narrowed `renderedDefaultValue` to non-nullable by `renderDefaultValue`
        renderedDefaultValue!,
      )}</span>`;
    }

    const chainedPropType = getChained(prop.type);

    if (
      prop.required ||
      /\.isRequired/.test(prop.type.raw) ||
      (chainedPropType !== false && chainedPropType.required)
    ) {
      propRaw = `<span class="prop-name required">${propRaw}<abbr title="required">*</abbr></span>`;
    } else {
      propRaw = `<span class="prop-name">${propRaw}</span>`;
    }

    if (prop.type.name === 'custom') {
      if (getDeprecatedInfo(prop.type)) {
        propRaw = `~~${propRaw}~~`;