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 break numbered lists and cannot be indented #1279

Closed
emanic opened this issue Mar 13, 2019 · 6 comments
Closed

Code tabs break numbered lists and cannot be indented #1279

emanic opened this issue Mar 13, 2019 · 6 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.

Comments

@emanic
Copy link

emanic commented Mar 13, 2019

🐛 Bug Report

I cannot currently nest the code tabs inside a numbered list. Normally, to nest something like a code block in a numbered list, you insert about three spaces in the Markdown. It shows up as an unnumbered paragraph in the HTML. Unfortunately, this does not work with Docusaurus and prevents use of the code tabs inside a numbered list.

In addition, unindented code tabs break the autonumbered list.

Have you read the Contributing Guidelines on issues?

Yes.

To Reproduce

Example #1:


1. Do this
<!--DOCUSAURUS_CODE_TABS-->
<!--tab1-->
```
some code
```
<!--tab2-->
```
some other code
```
<!--END_DOCUSAURUS_CODE_TABS-->
1. Do that

Example #2


1. Do this
   <!--DOCUSAURUS_CODE_TABS-->
   <!--tab1-->
   ```
   some code
   ```
   <!--tab2-->
   ```
   some other code
   ```
   <!--END_DOCUSAURUS_CODE_TABS-->
1. Do that

Expected behavior

Example #1:
Expected "Do that" to be #2

Example #2:
Expected code tabs to be properly indented and nested inside the numbered list.

Actual Behavior

Example #1:
"Do that" is #1
Screen Shot 2019-03-13 at 10 45 58 AM

Example #2:
No code tabs, just two indented code blocks.
Screen Shot 2019-03-13 at 10 42 37 AM

Reproducible Demo

Sorry I cannot make a public repo for you right now. Our repo is private.

@endiliey endiliey added bug An error in the Docusaurus core causing instability or issues with its execution good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. labels Mar 20, 2019
@jamesgeorge007
Copy link
Contributor

@emanic @endiliey I would love to work on this 🎉 I'm new here and am not that aware of the codebase. It would be great if you could throw light into what is to be done specifically (Preferably including code pointers) 👏

@endiliey
Copy link
Contributor

Hey awesome @jamesgeorge007 🎉, thank you for the interest. I'm sorry for the late response, sometimes I missed the notification.

I could point out where this code is. The logic is mainly here
https://github.com/facebook/Docusaurus/blob/866f66241b15f3a0b287010e25f5df39319610f8/packages/docusaurus-1.x/lib/core/Doc.js#L60-L82

There is also another bug issue related to it #1260

@endiliey endiliey added the help wanted Asking for outside help and/or contributions to this particular issue or PR. label Apr 12, 2019
@jamesgeorge007
Copy link
Contributor

@endiliey Can you nail it down throwing light on what is to be done specifically with the chunk of code 🤔

@endiliey
Copy link
Contributor

Technically you'd want to do something like #1369 to fix this problem. I don't think #1369 address this yet, but you would want to fix the way we parse the code.

I suggest working after that PR is merged

@zachbadgett
Copy link
Contributor

I have an idea on how to fix this specific issue. We would have a different regex matching that checks for the indentation (can probably just add an optional group (\t|\s{4})?), if it matches that we pass a prop settings to the function that splits it indicating we started as an indent.

@endiliey
Copy link
Contributor

endiliey commented May 2, 2019

#1369

@endiliey endiliey closed this as completed May 2, 2019
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 good first issue If you are just getting started with Docusaurus, this issue should be a good place to begin. help wanted Asking for outside help and/or contributions to this particular issue or PR.
Projects
None yet
Development

No branches or pull requests

4 participants