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

FIX: do not prettify primary sidebar html #965

Merged
merged 1 commit into from Sep 29, 2022
Merged

Conversation

12rambau
Copy link
Collaborator

Fix #929

same explaination as in my comment in the issue:

it seems that the problem is related to how we build the sidebar itself.

the generated html is:

<ul class="current nav bd-sidenav">
 <li class="toctree-l1">
  <a class="reference internal" href="page1.html">
   <cite>
    test
   </cite>
   .test
  </a>
 </li>
 <li class="toctree-l1 current active">
  <a class="current reference internal" href="#">
   test
  </a>
 </li>
</ul>

for the specific li "test.test" this is interpreted by my browser (and apparently yours) as:

<li class="toctree-l1">
  <a class="reference internal" href="page1.html">
    <cite> test </cite>
    " .test "
  </a>
</li>

which look like this:

Capture d’écran 2022-09-29 à 21 47 56

This piece of code is generated by this function

def generate_toctree_html(kind, startdepth=1, show_nav_level=1, **kwargs):
. I did some testing and it seems that removing the prettify() function from beautifulsoup is solving the problem as the output becomes:

<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="page1.html"><cite>test</cite>.test</a></li>
<li class="toctree-l1 current active"><a class="current reference internal" href="#">test</a></li>
</ul>

which look like:

Capture d’écran 2022-09-29 à 21 48 28

@12rambau 12rambau changed the title fix: do not prettify primary sidebar html FIX: do not prettify primary sidebar html Sep 29, 2022
@12rambau 12rambau marked this pull request as ready for review September 29, 2022 20:02
Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting - that was some nice investigation.

@drammock drammock merged commit 494e5e9 into pydata:main Sep 29, 2022
@12rambau 12rambau deleted the comas branch September 30, 2022 06:12
@jarrodmillman jarrodmillman added this to the 0.11 milestone Oct 5, 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

Successfully merging this pull request may close these issues.

[BUG] Showing module import path adds rudimentary space character
4 participants