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

Summary separators rendered with incorrect indentation #1730

Closed
OmarTawfik opened this issue Jan 19, 2022 · 5 comments
Closed

Summary separators rendered with incorrect indentation #1730

OmarTawfik opened this issue Jan 19, 2022 · 5 comments

Comments

@OmarTawfik
Copy link

Thanks for the awesome tool.
One issue I noticed, considering the following SUMMARY.md separators feature:

Separators are using the indentation of the block before it, not after it, which is incorrect in this case:

# Summary

- [Level One]()
  - [Example](./chapter_1.md)
 
---

- [Level Two]()
  - [Example](./chapter_1.md)

Which is rendered like this:

image

I suggest calculating the indentation from the entry after it, not before it, in order to fix this behavior.

@OmarTawfik
Copy link
Author

@ehuss happy to take a stab at this, but I'm not sure where to start. Any pointers would be appreciated.

@ehuss
Copy link
Contributor

ehuss commented Jan 25, 2022

I suspect it would be around here, where it uses an <li> for the spacer. Perhaps it could use a different tag, like <hr>? However, this would need careful consideration of how it will change existing users, and whether or not it will affect their expected rendering.

@kg4zow
Copy link

kg4zow commented May 31, 2022

I'm not sure if "me too" comments are appreciated, but I've noticed the same thing. Nobody reading my docs has mentioned it though, so I just figured it was just my "perfectionism" again (I tend to wrestle with the whole "perfect is the enemy of good" thing quite a bit).

FWIW I would suggest having the indendation of the separator bar in the HTML, somehow match the indentation of the first - in the SUMMARY.md text, so if the --- line has four spaces before the first -, the separator bar would be indented at the same "level" as other items in the file which have four spaces before them.

Either that, or just make separator bars always start from the left margin -- this seems like it might be simpler, but I haven't looked at it in detail so I can't say for sure.

If I were more familiar with Rust (and had the time) I would have a go at fixing it myself.

@mickvangelderen
Copy link

This seems to be a duplicate of #733

@ehuss
Copy link
Contributor

ehuss commented Jun 1, 2022

Indeed it looks to be a duplicate, thanks!

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Jun 1, 2022
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

No branches or pull requests

4 participants