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

feat(v2): various markdown string parsing improvements/fixes #4590

Merged
merged 6 commits into from
Apr 9, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Apr 9, 2021

Motivation

Refactors and improvements of the markdown parsing system:

  • Extract markdown-related code + tests in dedicated file
  • Clearer API surface
  • Title found in markdown content (not frontmatter) is returned as a separate attribute, not added to frontMatter.title => ability to handle those cases separately
  • Ability to extract title from markdown documents using the alternate markdown syntax (title\n===)
  • Fix empty excerpt when Markdown doc has a title: excerpt should simply skip/ignore the title
  • Duplicate title warning: better wording + ability to disable it (as it can be annoying for some sites after upgrading, cf RN website)
  • Initial code to have more strict frontmatter validation using Joi (to be completed)

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

tests

Related PRs

Follow-up of #4485 cc @armano2

Also related to #4582 (as we want to support better sites without any frontmatter at all)

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Apr 9, 2021
@slorber slorber requested a review from lex111 as a code owner April 9, 2021 14:03
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 9, 2021
@netlify
Copy link

netlify bot commented Apr 9, 2021

[V1]

Built with commit ee11036

https://deploy-preview-4590--docusaurus-1.netlify.app

@netlify
Copy link

netlify bot commented Apr 9, 2021

[V2]

Built with commit ee11036

https://deploy-preview-4590--docusaurus-2.netlify.app

@github-actions
Copy link

github-actions bot commented Apr 9, 2021

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 75
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4590--docusaurus-2.netlify.app/

@github-actions
Copy link

github-actions bot commented Apr 9, 2021

Size Change: 0 B

Total Size: 576 kB

ℹ️ View Unchanged
Filename Size Change
website/build/assets/css/styles.********.css 87.2 kB 0 B
website/build/assets/js/main.********.js 401 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 61.1 kB 0 B
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 26.1 kB 0 B

compressed-size-action

@slorber slorber changed the title feat(v2): improve markdown parsing feat(v2): various markdown string parsing improvements/fixes Apr 9, 2021
@slorber slorber merged commit 4efe682 into master Apr 9, 2021
@slorber slorber deleted the slorber/extract-fix-excerpt branch August 17, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants