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

Add support for Lua comment style for MagicComments #8859

Closed
6 of 7 tasks
jcarrillo7 opened this issue Apr 1, 2023 · 4 comments · Fixed by #8870
Closed
6 of 7 tasks

Add support for Lua comment style for MagicComments #8859

jcarrillo7 opened this issue Apr 1, 2023 · 4 comments · Fixed by #8870
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.

Comments

@jcarrillo7
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

The current magic comment syntax for highlighting is great but it doesn't have support for Lua's comment style.
Lua uses -- for short single line comments. Right now I resort to using to using the C/Python comment styles as a workaround but this makes copy/pasting/testing the code snippets a pain since I need to keep removing these invalid lines.

Reproducible demo

No response

Steps to reproduce

  • Use lua language in CodeBlock
  • use magic comments to highlight regions of code

Expected behavior

Expected -- highlight-start and -- highlight-end to work in lua but it does not.

Actual behavior

Does not work

Your environment

No response

Self-service

  • I'd be willing to fix this bug myself.
@jcarrillo7 jcarrillo7 added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Apr 1, 2023
@Josh-Cena
Copy link
Collaborator

Thanks, Haskell also uses this syntax, so we will get it in. However, it won't be turned on unless specifically in lua/Haskell code boxes to avoid ambiguity with the -- operator in C-like languages.

@Josh-Cena Josh-Cena added good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. and removed status: needs triage This issue has not been triaged by maintainers bug An error in the Docusaurus core causing instability or issues with its execution labels Apr 1, 2023
@morsko1
Copy link
Contributor

morsko1 commented Apr 7, 2023

I can see that -- ... syntax is also used in SQL for single line comments. Along with /* ... */ syntax for multi-line comments.
So, maybe it makes sense to handle this case as well.

@DeepakSR-12
Copy link

Hi @jcarrillo7 . I'd like to work on this issue. Can you please assign this to me?

@Josh-Cena
Copy link
Collaborator

@DeepakSR-12 Please check the issue more carefully. It already has a linked PR #8870.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin.
Projects
None yet
4 participants