-
Notifications
You must be signed in to change notification settings - Fork 142
Fix anchors for panel headers #454
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
Conversation
e45d2b9 to
c002fc2
Compare
|
The tests are passing locally on my machine (windows) but for some reason Travis seems to be failing. Somehow when rendered on Travis the block of code I added causes the Could I get some help on this? |
2eafdb6 to
eb2f83a
Compare
test/test_site/testUtil/diffHtml.js
Outdated
| } | ||
|
|
||
| if (isDiff(part) && !insidePath) { | ||
| if (isDiff(part) && !insidePath && !isPathSeparatorDiff(part.value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change here allows for this situation to pass:
expected.html
<div> \ </div>actual.html
<div> / <div>
The reason is because Travis is running a unix env and the path separator generated will be As for the diff that is being shown, I would think my diffing code will account for that and not trigger an error. Sorry about that 🙏. I will help to look into the matter. Also see my comment about your fix! |
|
I found the bug: its found in The fragment that causes this is (note i've formatted it for readability) <panel header="## Panel with src from another Markbind site header<a class='fa fa-anchor' href='#panel-with-src-from-another-markbind-site-header'></a>"
src="/test_site
+/
-\
sub_site/index._include_.html" expanded=""></panel>To decide if the diff
Would a good solution be to check the parity of the |
|
@nicholaschuayunzhi Nice! I'll go ahead and remove that line. Will wait for your PR to be merged first. |
|
@jamos-tay The fix has been merged to master, you can go ahead and rebase on master and also drop commits |
d6e6851 to
1d248c4
Compare
|
Sure, updated 👍 |
|
Yeah... the dimensions of the header seems to be different for headers in panels. I'll try and find a fix |
|
@yamgent Hey, think it should be fixed now. There's still a minor nit where the anchor will disappear if the user hovers over the header text first, then moves the mouse right until the empty space (basically |
yamgent
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍
Just one minor nit left:
|
Changes made |


What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [X] Bug fix
Fixes #442
What is the rationale for this request?
Anchors were not being generated for panel headers, and in a previous version do not redirect to the page when clicked.
What changes did you make? (Give an overview)
Anchors should now be generated for panel headers correctly.
The panel headers are stored in the panel's
headerattribute and rendered by vue, so headings weren't being picked up byPage. I worked around this by checking all panels for theheaderattribute and adding the anchor html there.As for the links not working previously (see #442 (comment)), I added some code to
setup.jsto manually redirect the page when an anchor is clicked, it seems to be working as expected now.