mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 09:23:52 -05:00
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:  This fixes it by removing one layer of escaping.
This commit is contained in:
@@ -106,7 +106,7 @@ describe('Basic unfurls', () => {
|
||||
const res = await prom;
|
||||
expect(res.metadata).toEqual({
|
||||
ogDescription:
|
||||
'\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',
|
||||
'\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++',
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user