-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Indented codeblocks throw off all future codeblocks #28
Comments
Yeah, sounds good. Feel free to reach out / submit a draft PR if you encounter any struggles |
What would you consider a solution here? Since we lint MD files by "converting" them into Ruby files, the |
Is this extension supposed to care about the indentation of codeblocks themselves in the first place? If I put my codeblock 10 spaces to the right then all I really care about is that the code inside is properly indented relative to that. Anything else feels out of scope, to me at least. One thing I feel that would be a big help here is by using rubocops 3rd party template support that got added in 1.45. rubocop/rubocop#10839 Would you be open to exploring that? It is pretty involved for this issue and probably more work that necessary. Just want to get your feelings on this, perhaps for something in the future. |
Oh, haven't seen this; awesome! Yeah, we should migrate to this new API. |
Great to hear! I think I'll try to start with that as I feel it will make fixing this as a second step easier. I feel like nobody has complainted about this issue yet so you can take a bit of time for this. |
Coming here as I tested this to link our 2k+ markdown doc files, and see the same issue. @palkan Re: My suggestion would be to count the number of spaces before the start of the code block, and trim that amount until the end of the code block. So: List item:
- ```ruby
valid, trim 2 characters from every line.
```
- Nest some more:
- ```ruby
valid, trim 4 from every line
```
- ```ruby
invalid indentation, trim 4 from every line, but this line still ends up with 2 extra spaces
``` After trimming: List item:
```ruby
valid, trim 2 characters from every line.
```
- Nest some more:
```ruby
valid, trim 4 from every line
```
```ruby
invalid indentation, trim 4 from every line, but this line still ends up with 2 extra spaces
``` |
rubocop.yml
test.md since I still don't know how to properly escape markdown here.
I'll try to check this out myself if that's fine with you @palkan, but in case I don't manage like last time I'll let you know. That good?
The text was updated successfully, but these errors were encountered: