Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run Markdown through a try-catch in the Explorer #34

Closed
erunion opened this issue May 9, 2020 · 1 comment
Closed

Run Markdown through a try-catch in the Explorer #34

erunion opened this issue May 9, 2020 · 1 comment

Comments

@erunion
Copy link
Member

erunion commented May 9, 2020

If someone happens to have an API Reference page with the following Markdown with invalid CSS, the Markdown engine will currently fail, taking the rest of the Explorer component down with it.

<p style="font-size:15px;font-family=Lato, proxima-nova, Helvetica Neue, Arial, sans-serif;color: #001a00;text-align:justify;">Pickup location are required to be created from where pickup has to be done. One time pickup location can also be created through Warehouse creation API.</p>

All Markdown runs through the Explorer should be handled through a try-catch so if it fails, we just fallback to rendering plaintext.

@rafegoldberg
Copy link
Contributor

rafegoldberg commented May 12, 2020

is this still an issue? I tried it locally and it only seems to break the single endpoint (rather than the whole explorer?) But if it is, I think we could wrap a try/catch around the default RDMD export and fix this e’erywhere in one fell swoop, no? Something like:

const ReadMeMarkdown = (text, opts = {}) => {
  try {
    return react(text, opts);
  } catch (e) {
    console.error(e);
    return e;
  }
};

@rafegoldberg rafegoldberg transferred this issue from readmeio/api-explorer Aug 4, 2020
@erunion erunion closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants