import React from "react";
import { parseMarkdown } from "../../util/parseMarkdown";

export default function MarkdownDisplay({ mdstring, ...props }) {
  let cleanDescription;
  try {
    cleanDescription = parseMarkdown(mdstring);
  } catch (error) {
    console.error(`Error parsing footer description: ${error}`);
    cleanDescription = '<p>There was an error parsing the footer description.</p>';
  }
  return (
    <div
      {...props}
      dangerouslySetInnerHTML={{ __html: cleanDescription }} // eslint-disable-line react/no-danger
    />
  );
}

import React from "react";
import { parseMarkdown } from "../../util/parseMarkdown";

export default function MarkdownDisplay({ mdstring, ...props }) {
  let cleanDescription;
  try {
    cleanDescription = parseMarkdown(mdstring);
  } catch (error) {
    console.error(`Error parsing Markdown: ${error}`);
    cleanDescription = '<p>There was an error parsing the Markdown.  See the JS console.</p>';
  }
  return (
    <div
      {...props}
      dangerouslySetInnerHTML={{ __html: cleanDescription }} // eslint-disable-line react/no-danger
    />
  );
}

Update error message to reflect current usage
markdownDisplay: Update error message to reflect current usage

Used by narratives too, not just the dataset footer.  About to be used
in the fine print component as well.
