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

Indentation broken when folding heading followed by list #25

Closed
nokola opened this issue May 18, 2018 · 5 comments
Closed

Indentation broken when folding heading followed by list #25

nokola opened this issue May 18, 2018 · 5 comments

Comments

@nokola
Copy link
Contributor

nokola commented May 18, 2018

Steps to reproduce:

  1. Open https://laobubu.net/HyperMD/
  2. Paste:
# Test folding indent
1. Ensure test cert in player settings is not expired. Create new one if needed
  1. Fold top heading

Expected:
All OK

Actual:
heading is folded but also offsets incorrectly
image

@laobubu
Copy link
Owner

laobubu commented May 18, 2018

Seems it is a bug of CodeMirror. List lines' style is unexpectedly merged to header lines'.

Add a normal paragraph after the list and everything goes correctly.

@nokola
Copy link
Contributor Author

nokola commented May 18, 2018

I think it's specific to HyperMD. For example, CodeMirror official demo works:
https://codemirror.net/demo/folding.html
image

image

Perhaps it's something else due to the folding plugin? or some option missing?

@laobubu
Copy link
Owner

laobubu commented May 18, 2018

pre.HyperMD-header {
  padding-left: 0 !important
}
pre.HyperMD-header  > span > span:first-child {
 margin-left: 0 !important
}

Not sure if this works. Written on my phone

@nokola
Copy link
Contributor Author

nokola commented May 18, 2018

yes, works, thanks for the response.
Found another, maybe related issue:

H2

test

code

H2

The H2 appears broken style if it ends with code:
image

@laobubu
Copy link
Owner

laobubu commented May 20, 2018

When content is folded, the style of last line is merged to the heading line. Therefore, to fix this, give header line's style higher priority, like ....

.cm-s-hypermd-light pre.HyperMD-header {
    line-height: 1.5 !important;
    font-family: inherit !important;
    border: 0 !important;
}

Hmmm... anyway, it works.

ryooo pushed a commit to ryooo/HyperMD that referenced this issue Nov 20, 2020
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

2 participants