Bladeren bron

fix parseAmpImg for replace extra space

weichen 4 jaren geleden
bovenliggende
commit
1ddcbc1e9c
1 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 5 5
      backstage/static/js/parsers.js

+ 5 - 5
backstage/static/js/parsers.js

@@ -101,19 +101,19 @@ const parseTitle = line => {
 
 const parseAmpImg = line => {
   if (line.includes('alt')) {
-    const altParameter = line.replace(/alt=|"/g, '');
+    const altParameter = line.replace(/ |alt=|"/g, '');
     return {alt: altParameter};
   } else if (line.includes('src')) {
-    const srcParameter = line.replace(/src=|"/g, '');
+    const srcParameter = line.replace(/ |src=|"/g, '');
     return {src: srcParameter};
   } else if (line.includes('height')) {
-    const heightParameter = line.replace(/height=|"/g, '');
+    const heightParameter = line.replace(/ |height=|"/g, '');
     return {height: heightParameter};
   } else if (line.includes('width')) {
-    const widthParameter = line.replace(/width=|"/g, '');
+    const widthParameter = line.replace(/ |width=|"/g, '');
     return {width: widthParameter};
   } else if (line.includes('layout')) {
-    const layoutParameter = line.replace(/layout=|"|>/g, '');                             
+    const layoutParameter = line.replace(/ |layout=|"|>/g, '');                             
   }
 }