wpilibsuite / sphinxext-opengraph

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

Quotes aren't escaped in the Open Graph description, causing some descriptions to end early #46

Closed Calinou closed 2 years ago

Calinou commented 2 years ago

sphinxext-opengraph version: 0.4.2

Example with this page: https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html

Results in:

<meta property="og:title" content="Pull request workflow" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://docs.godotengine.org/en/stable/community/contributing/pr_workflow.html" />
<meta property="og:site_name" content="Godot Engine documentation" />
<meta property="og:description" content="The so-called "PR workflow" used by Godot is common to many projects using Git, and should be familiar to veteran free software contributors. The idea is that only a small number (if any) commit di..." />
<meta name="description" content="The so-called &quot;PR workflow&quot; used by Godot is common to many projects using Git, and should be familiar to veteran free software contributors. The idea is that only a small number (if any) commit directly to...">

The Open Graph description on the second-to-last line isn't escaped correctly, but the meta description on the last line is.

Note that we don't have "smart quotes" enabled on godot-docs, so ASCII quote characters remain ASCII quote characters instead of being transformed into characters like and .

Daltz333 commented 2 years ago

Is that valid HTML? I'm reading something different, https://stackoverflow.com/questions/1137045/meta-description-quotes-escape

Also https://theseosystem.com/quotes-in-meta-tags-description/

Daltz333 commented 2 years ago

Oh wait. I see, we should implement this.