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

fix(docs) Fix nested markdown in MDX components #23160

Closed
wants to merge 4 commits into from

Conversation

tesseralis
Copy link
Contributor

@tesseralis tesseralis commented Apr 16, 2020

Description

Fix formatting of <Pullquote>, <figcaption> and <VisuallyHidden> to handle nested markdown links in them and multi-line content.

Motivation

  • Some of our links were broken
  • soft-wrapped text is easier to translate

TODO:

  • Check the build to make sure things are still rendered correctly

@AishaBlake
Copy link

I tried looking at some of these pages locally and I'm not seeing a difference between some of the pages I spot checked. Others, I'm getting this error when I attempt to view a post.

TypeError: Cannot read property 'frontmatter' of null
BlogPostTemplate.render
src/templates/template-blog-post.js:39
  36 | )
  37 | let canonicalLink
  38 | 
> 39 | if (post.frontmatter.canonicalLink) {
  40 |   canonicalLink = (
  41 |     <link rel="canonical" href={post.frontmatter.canonicalLink} />
  42 |   )
View compiled
▶ 16 stack frames were collapsed.
(anonymous function)
/Users/aishablake/gatsby/www/.cache/app.js:67
  64 | const preferDefault = m => (m && m.default) || m
  65 | let Root = preferDefault(require(`./root`))
  66 | domReady(() => {
> 67 |   renderer(<Root />, rootElement, () => {
  68 |     apiRunner(`onInitialClientRender`)
  69 |   })
  70 | })
View compiled

@tesseralis tesseralis requested a review from a team as a code owner April 30, 2020 02:04
@tesseralis
Copy link
Contributor Author

The build is failing because it can't parse figcaptions correctly:

<figure>
  <img
    alt="Gatsby swag posts on Twitter."
    src="./images/gatsby-swag-twitter.jpg"
  />
  <figcaption>

Tweets from [Dean](https://twitter.com/DeaNHtiD99/status/1023204484183416832), [Elle](https://twitter.com/ARebelBelle/status/1020044426712735744), [Chase](https://twitter.com/chaseadamsio/status/1021896138503245824), and [Katherine](https://twitter.com/kato_katherine/status/1021967765400211456) showing off their new Gatsby swag.

  </figcaption>
</figure>

For some reason the top <figcaption> tag gets closed when compiling with gatsby-plugin-mdx.

@AishaBlake
Copy link

@tesseralis did you want additional feedback on this? Input from the Content team specifically? Something else?

@tesseralis
Copy link
Contributor Author

@AishaBlake on pause for now since working on other stuff like the theme refactor. Should I close this PR for now?

@AishaBlake
Copy link

Sounds good to me! We can revisit later.

@AishaBlake AishaBlake closed this May 11, 2020
@LekoArts LekoArts deleted the mdx-nested-markdown branch November 9, 2020 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants