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

Readme HTML has broken internal links #58

Closed
simonw opened this issue Dec 16, 2020 · 2 comments
Closed

Readme HTML has broken internal links #58

simonw opened this issue Dec 16, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@simonw
Copy link
Collaborator

simonw commented Dec 16, 2020

From simonw/datasette.io#46

<li><a href="#filtering-tables">Filtering tables</a></li>
...
<h3><a id="user-content-filtering-tables" class="anchor" aria-hidden="true" href="#filtering-tables"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Filtering tables</h3>

So this is a bug in GitHub's API, but we need to work around it.

@simonw simonw added the bug Something isn't working label Dec 16, 2020
@simonw
Copy link
Collaborator Author

simonw commented Dec 16, 2020

I'm going to rewrite those <a href="#filtering-tables"> links to <a href="#user-content-filtering-tables"> - but only if a corresponding id="user-content-filtering-tables" element exists.

@simonw
Copy link
Collaborator Author

simonw commented Dec 16, 2020

I don't want to add a full HTML parser (like BeautifulSoup) as a dependency for this feature. Since the HTML comes from a single, trusted source (GitHub) I could probably handle this using regular expressions.

@simonw simonw closed this as completed in b8e85c0 Dec 16, 2020
simonw added a commit that referenced this issue Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant