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(link): Remove hash before checking if ending by '.md' #2033

Merged
merged 2 commits into from Apr 28, 2023

Conversation

Skraye
Copy link
Contributor

@Skraye Skraye commented Apr 20, 2023

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

Does not know if it's a bug fix or an enhancement.

πŸ“š Description

The PR consists of allowing hash in a relative title.

Example of an URL used in our md files :
../docs/04.developer-guide/04.inputs.md#set-inputs-with-curl

Without the hash part, this works fine and the URL is well interpreted, but we notice that having a hash will break the functionality.

In fact, the method normalizeLink() works only with relative files that end with .md, so we added hash handling in this function, which is just a regex that removes hash, and set it back before returning.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly. -> Did not find any documentation about this.

@codesandbox
Copy link

codesandbox bot commented Apr 20, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Apr 20, 2023

βœ… Deploy Preview for nuxt-content canceled.

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit 230d2d0
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/644232acc05ab40008d3a7cd

@farnabaz
Copy link
Member

Thanks for the PR @Skraye,
Do you mind adding a test for this?

@Skraye
Copy link
Contributor Author

Skraye commented Apr 21, 2023

Hi @farnabaz
Did update the test !

Copy link
Member

@farnabaz farnabaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘

@farnabaz farnabaz merged commit c65a2b4 into nuxt:main Apr 28, 2023
7 checks passed
@farnabaz farnabaz mentioned this pull request Jun 13, 2023
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