diff --git a/client/src/document.js b/client/src/document.js index 1f936516c5a1..fb9a8c8309d1 100644 --- a/client/src/document.js +++ b/client/src/document.js @@ -4,7 +4,7 @@ import { Link } from "@reach/router"; import { NoMatch } from "./routing"; import { InteractiveExample } from "./ingredients/interactive-example"; import { Attributes } from "./ingredients/attributes"; -import { Examples } from "./ingredients/examples"; +import { Example, Examples } from "./ingredients/examples"; import { BrowserCompatibilityTable } from "./ingredients/browser-compatibility-table"; export class Document extends React.Component { @@ -149,7 +149,7 @@ function RenderDocumentBody({ doc }) { if (section.type === "prose") { // Only exceptional few should use the component, // as opposed to . - if (PROSE_NO_HEADING.includes(section.value.id)) { + if (!section.value.id || PROSE_NO_HEADING.includes(section.value.id)) { return ; } else { return ( @@ -180,6 +180,8 @@ function RenderDocumentBody({ doc }) { ); } else if (section.type === "examples") { return ; + } else if (section.type === "example") { + return ; } else if (section.type === "info_box") { // XXX Unfinished! // https://github.com/mdn/stumptown-content/issues/106 diff --git a/client/src/ingredients/examples.js b/client/src/ingredients/examples.js index ee51976e5dd5..5b3aa9534dad 100644 --- a/client/src/ingredients/examples.js +++ b/client/src/ingredients/examples.js @@ -92,3 +92,7 @@ export function Examples({ examples }) { ); } + +export function Example({ example }) { + return ; +}