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

Code Tabs do not allow HMTL comments within code blocks #1260

Closed
Glavin001 opened this issue Mar 4, 2019 · 5 comments · Fixed by #1369
Closed

Code Tabs do not allow HMTL comments within code blocks #1260

Glavin001 opened this issue Mar 4, 2019 · 5 comments · Fixed by #1369
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@Glavin001
Copy link
Contributor

Glavin001 commented Mar 4, 2019

🐛 Bug Report

Language-specific Code Tabs creates a new tab for HTML comments within code blocks.

Related to:

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

  1. Use the following Markdown: https://gist.github.com/Glavin001/88acfd445ecdd013b129a412fd180b75
  2. Run Docusaurus and view page.

Expected behavior

Should have HTML tab:

image

Actual Behavior

Should have HTML tab and not have a tab for the HTML comment:

image

image

Reproducible Demo

See Unibeautify/website#211 (comment)

@endiliey endiliey added the bug An error in the Docusaurus core causing instability or issues with its execution label Mar 5, 2019
@fiennyangeln
Copy link
Contributor

I think this is due to our syntax choice for the CodeTabs and can be fixed by changing the syntax. However, we need to think of what syntax to use such that it doesn't overlap with any language syntax. E.g adding DOCUSAURUS in the syntax?

@endiliey
Copy link
Contributor

@fiennyangeln That's a very easy and clean fix. Another fix is to not include those on codeblocks as part of tab.

Sometimes I wonder if these kind of feature should've best been left as a markdown parser plugin.

Wanna send a PR ? 😄

@yangshun
Copy link
Contributor

I found a Remarkable plugin that does something similar - https://www.npmjs.com/package/remarkable-codegroup

@fiennyangeln
Copy link
Contributor

yeah but it requires jQuery and bootstrap as mentioned here and here so idk if it's ok to use it. What do you all think?

@DiegoFelipe
Copy link

DiegoFelipe commented Apr 12, 2019

I'm not using comments in html but I got the same problem if I put a comment like this:

<!--- a comment ---!>

into a markdown file, docusaurus don't work anymore after this comment, If I remove the comment it works again.

@update

It actually bugs if you put an url in a comment, I just removed the link from the comment and it worked!

@update2

It's actually so weird, sometimes it works with comment and sometimes don't, And if I put two comments in a md file it only hides the first comment...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants