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

fetch readme.md as mdx #5298

Merged
merged 17 commits into from
Aug 19, 2021
Merged

fetch readme.md as mdx #5298

merged 17 commits into from
Aug 19, 2021

Conversation

chenxsan
Copy link
Member

@chenxsan chenxsan commented Aug 14, 2021

There're two types of contents in this repository:

  1. those we create right under src/content which we can use mdx safely
  2. those read from readme.md file hosted on github, e.g., webpack-contrib/css-loader

This pull request is an attempt to handling the second type as mdx. It might not work as I expected, which means we'll have to maintain both .md and .mdx on this repository.

  • close img element
  • fix those problems in readme.md files.

Btw, we're leaving those md related configuration at the moment as the downstream repositories might have their own md files, e.g., https://github.com/docschina/webpack.js.org/blob/cn/src/content/plugins/terser-webpack-plugin.md. I'll eliminate those md related configuration in near future.

clean up div[align='center']

Unfortunately the original regular expression for cleaning up div[align='center'] is defective, it can't handle a nested one:

<div align="center">
  <img 
    width="180" 
    height="180" 
    hspace="10"
    alt="PostCSS Logo"
    src="https://api.postcss.org/logo.svg">
  <a href="https://github.com/webpack/webpack">
    <img 
      width="200" 
      height="200" 
      hspace="10"
      src="https://cdn.rawgit.com/webpack/media/e7485eb2/logo/icon.svg">
  </a>
  <div align="center">
    <a href="https://evilmartians.com/?utm_source=postcss">
      <img 
        src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
        alt="Sponsored by Evil Martians" 
        width="236" 
        height="54" 
        vspace="10">
    </a>
  </div>
</div>

Thus I'm turning to a remark plugin to resolve it.

@vercel
Copy link

vercel bot commented Aug 14, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/webpack-docs/webpack-js-org/7ga4eySAiAkbnuBHCV28gBBQbYaK
✅ Preview: https://webpack-js-org-git-fork-chenxsan-feature-mi-68afc3-webpack-docs.vercel.app

@chenxsan chenxsan marked this pull request as ready for review August 18, 2021 14:22
@chenxsan chenxsan merged commit 702390a into webpack:master Aug 19, 2021
@chenxsan chenxsan deleted the feature/migrate-mdx branch August 19, 2021 04:40
@chenxsan chenxsan mentioned this pull request Aug 20, 2021
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.

2 participants