Skip to content

Comments

fix(v2): fix title logic (meta vs heading) + ignore fixed anchor id syntax#4688

Merged
slorber merged 8 commits intomasterfrom
slorber/markdown-title-parsing-fixes
Apr 27, 2021
Merged

fix(v2): fix title logic (meta vs heading) + ignore fixed anchor id syntax#4688
slorber merged 8 commits intomasterfrom
slorber/markdown-title-parsing-fixes

Conversation

@slorber
Copy link
Collaborator

@slorber slorber commented Apr 27, 2021

Motivation

Fixes #4665 (comment) + handle fixed anchor syntax

Keep behavior we had before:

  • frontmatter.title controls page meta in priority
  • markdown # title controls page h1 heading in priority

We should rather not use fixed anchor ids syntax on top level h1 headings, as user should not use h1 headings in his doc normally anyway:

  • writeHeadingIds cli will not write custom anchor ids for h1 md titles, and # myTitle remains untouched
  • a markdown title as # myTitle {#my-anchor} will now parse correctly title = myTitle

Have you read the Contributing Guidelines on pull requests?

yes

Test Plan

test

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Apr 27, 2021
@slorber slorber requested a review from lex111 as a code owner April 27, 2021 13:03
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 27, 2021
@netlify
Copy link

netlify bot commented Apr 27, 2021

@netlify
Copy link

netlify bot commented Apr 27, 2021

@github-actions
Copy link

github-actions bot commented Apr 27, 2021

⚡️ Lighthouse report for the changes in this PR:

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

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

@github-actions
Copy link

github-actions bot commented Apr 27, 2021

Size Change: 0 B

Total Size: 631 kB

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

compressed-size-action

@slorber slorber merged commit 8ebbc17 into master Apr 27, 2021
@slorber slorber deleted the slorber/markdown-title-parsing-fixes branch August 17, 2021 18:00
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: bug fix This PR fixes a bug in a past release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Titles are not handled properly anymore

2 participants