wpilibsuite / sphinxext-opengraph

Sphinx extension to generate unique OpenGraph metadata
https://sphinxext-opengraph.readthedocs.io
Other
74 stars 27 forks source link

Title meta content has extra span tags that end up being invalid #3

Closed partofthething closed 4 years ago

partofthething commented 4 years ago

I ran this and checked the source to find something like this:

    <meta property="og:title" content="<span class="section-number">3. </span>Documenting ARMI" />
    <meta property="og:type" content="website" />

The title content shouldn't have the HTML span in it. This is using a sphinx-rtd-theme.

ItayZiv commented 4 years ago

Can you send the source rst and conf.py?

Note: currently the description might only partly work (might grab text it shouldn’t be)

partofthething commented 4 years ago

Sure, it's this documentation: https://github.com/terrapower/armi/tree/master/doc

ItayZiv commented 4 years ago

Do you know if any of the other extensions you are using would have something to do with section numbering? I assume this is the page you are talking about https://terrapower.github.io/armi/_sources/developer/documenting.rst.txt , it seems like it would have to be some other extension interfering because we grab the title directly from Sphinx, ill try see if I can isolate the issue.

TheTripleV commented 4 years ago

More info on issue:

On the developer/documenting.rst page, when the open graph extension runs,

  1. context['title'] = '<span class="section-number">3. </span>Documenting ARMI'
  2. The doctree does not include this span class. The first title in the doctree is Documenting ARMI
  3. The generated html's title is <title>3. Documenting ARMI &mdash; ARMI 0.1.4 documentation</title>
  4. The generated html's title repeated is the first header is ...<span class="section-number">3. </span>Documenting ARMI...
ItayZiv commented 4 years ago

Just an update, to be clear, this is caused from the toctree having the :numbered: directive, fix should come soon.