This commit is contained in:
robbieandrew
2025-08-01 09:15:05 +02:00
parent c5107b1431
commit d1e364dae3
2 changed files with 9 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 1200.000 674.916">
<title>Taiwan's monthly fossil CO2 emissions</title>
<style type="text/css">
<style type="text/css">
<!-- comment -->
#main {font-family:Helvetica,Arial,sans-serif; font-size:27.00px;
fill-opacity:1; fill:#000000; stroke:none; stroke-linejoin:round; stroke-linecap:round; stroke-width:1.00;}
a:hover {text-decoration: underline;}

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

@@ -4,6 +4,13 @@ function addSVGmetadata(svgObject) {
const svgDoc = svgObject.contentDocument;
if (!svgDoc) return;
// Check if the metadata span already exists as the next sibling
const container = svgObject.parentNode;
const existingMetadata = container.querySelector('.chart-metadata');
if (existingMetadata) {
return; // If it exists, do nothing and exit the function.
}
// Use a Set to retain only unique strings
const texts = new Set();