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(markdown): keep meta from fenced code block #1800

Merged
merged 2 commits into from Jan 12, 2023

Conversation

Qwertovsky
Copy link
Contributor

❓ 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)

πŸ“š Description

Don't drop a info from fenced code

```javascript[file.js]{4-6,7} meta-info=val
export default () => {
  console.log('Code block')
}
```

So meta-info=val will be accessible from the document tree after parsing. Property meta will be next to language, filename, highlights.
It can help to do other modifications with remark plugins, transformers, or ProseCode component.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@nuxt-studio-dev
Copy link

nuxt-studio-dev bot commented Jan 6, 2023

βœ… Deploy Preview for demo-blog-nuxt-content ready!

Name Link
πŸ”¨ Latest commit 5a4a35d
😎 Deploy Preview https://content.nuxtjs.org?preview=77f6ccc278e45b90138daed06a862203

@netlify
Copy link

netlify bot commented Jan 6, 2023

βœ… Deploy Preview for nuxt-content ready!

Built without sensitive environment variables

Name Link
πŸ”¨ Latest commit 5a4a35d
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt-content/deploys/63bf228e0825660009573c96
😎 Deploy Preview https://deploy-preview-1800--nuxt-content.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@nuxt-studio-dev
Copy link

βœ… Deploy Preview for demo-blog-nuxt-content ready!

Name Link
πŸ”¨ Latest commit cbce38a
😎 Deploy Preview https://content.nuxtjs.org?preview=77f6ccc278e45b90138daed06a862203

@Atinux Atinux requested a review from farnabaz January 6, 2023 16:16
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.

LGTM πŸ‘

@farnabaz
Copy link
Member

@Qwertovsky do you mind fixing linter issues?

test/features/parser-markdown.ts Outdated Show resolved Hide resolved
Co-authored-by: nobkd <44443899+nobkd@users.noreply.github.com>
@farnabaz farnabaz merged commit 0aa922c into nuxt:main Jan 12, 2023
@farnabaz farnabaz mentioned this pull request Jan 23, 2023
@SimonScholz
Copy link

The sample mentioned above using {4-6,7} is not targeting the sample code since it has only 3 lines.

image

This is really unfortunate because I am currently facing the issue that no different highlighting is applied to the lines in brackets, e.g., {4-6,7}
Shall I open a bug for this or is the {4-6,7} somehow not supported?

@nobkd
Copy link
Contributor

nobkd commented Sep 26, 2023

@SimonScholz
This problem should be fixed with nuxt-modules/mdc#21. Will probably be fixed in Nuxt Content when a new version of Content gets released. It's already updated in edge channel.

Update: Fix was released with v2.8.3.

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

4 participants