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

Links to span id defined anchors are not clickable #130

Open
pstavirs opened this issue Oct 14, 2022 · 0 comments
Open

Links to span id defined anchors are not clickable #130

pstavirs opened this issue Oct 14, 2022 · 0 comments

Comments

@pstavirs
Copy link

pstavirs commented Oct 14, 2022

If an id is defined for a span element in the source MD/HTML, an href to it is not clickable in the generated PDF. If I change span to div the problem is not seen.

Here's a minimal example -

$ cat mkdocs.yml 
site_name: My Docs
plugins:
    - with-pdf:
        show_anchors: true
$ cat docs/index.md 
# Welcome to MkDocs

For full documentation visit [mkdocs.org](https://www.mkdocs.org).

## Commands

* `mkdocs new [dir-name]` - Create a new project.
* `mkdocs serve` - Start the live-reloading docs server.
* `mkdocs build` - Build the documentation site.
* `mkdocs -h` - Print help message and exit.

<span id="span_id"/>
<div id="div_id"/>
<a id="a_id"/>

## Project layout

    mkdocs.yml    # The configuration file.
    docs/
        index.md  # The documentation homepage.
        ...       # Other markdown pages, images and other files.

The build only generates the div_id anchor point, not the span_id or a_id -

$ mkdocs build
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: /home/srivatsp/Code/span-test/site
INFO     -  Number headings up to level 3.
INFO     -  Generate a table of contents up to heading level 2.
INFO     -  Generate a cover page with "default_cover.html.j2".
INFO     -  Converting <img> alignment(workaround).
INFO     -  Anchor points provided:
INFO     -  | #.:
INFO     -  | #.:commands
INFO     -  | #.:div_id
INFO     -  | #.:project-layout
INFO     -  | #.:welcome-to-mkdocs
INFO     -  | #author
INFO     -  | #copyright
INFO     -  | #doc-cover
INFO     -  | #doc-toc
INFO     -  Rendering for PDF.
INFO     -  Output a PDF to "/home/srivatsp/Code/span-test/site/pdf/document.pdf".
INFO     -  Converting 1 articles to PDF took 19.0s
INFO     -  Documentation built in 19.26 seconds
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

1 participant