Don't double escape metadata (#8296)

Before this PR, source code in the `<meta name="description">` and
`<meta property="og:description">` tags would be doubly escaped, leading
to html escaped code showing up in link previews. Examples:

Discord:
<img width="465" height="167" alt="discord"
src="https://github.com/user-attachments/assets/d2f867e6-f724-4177-8f1d-17986d13343f"
/>

Akkoma:

![akkoma](https://github.com/user-attachments/assets/22b11c48-1bef-4424-a70a-3948213a8354)


This fixes it by removing one layer of escaping.
This commit is contained in:
nrdmn
2025-12-16 00:50:07 +01:00
committed by GitHub
parent adca61373a
commit 4bcd8e2b52
2 changed files with 2 additions and 6 deletions

View File

@@ -106,7 +106,7 @@ describe('Basic unfurls', () => {
const res = await prom;
expect(res.metadata).toEqual({
ogDescription:
'\ntemplate&lt;typename T&gt;\nconcept TheSameAndAddable = requires(T a, T b) {\n {a+b} -&gt; T;\n};\n\ntemplate&lt;TheSameAndAddable T&gt;\nT sum(T x, T y) {\n return x + y;\n}\n\n#include &lt;string&gt;\n\nint main() {\n int z = 0;\n int w;\n\n return sum(z, w);\n}\n',
'\ntemplate<typename T>\nconcept TheSameAndAddable = requires(T a, T b) {\n {a+b} -> T;\n};\n\ntemplate<TheSameAndAddable T>\nT sum(T x, T y) {\n return x + y;\n}\n\n#include <string>\n\nint main() {\n int z = 0;\n int w;\n\n return sum(z, w);\n}\n',
ogTitle: 'Compiler Explorer - C++',
});
});