Need help with my JavaScript RegEx

I working on a JavaScript program to output formatted span tags to be pasted into a pre tag for code blocks in my blog posts. 1. I got a RegEx to capture the double-quotes and content in between them for some HTML attributes. 2. I have an HTML entities conversion function for < > ' " and & and I use the result to add a span tag with a class for a paragraph class and image src but not tor a title tag without any attributes. 3. Then I output the html entity conversions with the span tags around them, plus a different span and class around each line. I'm getting the result I want but for some reason my class and src values out outputting twice. It looks like my RegEx is returning an array of 2 matches for each attribute. I wrote another function called matches to convert the array to a string and use that output to write to the DOM but I'm getting an error: line.match is not a function at line 75 of my JS code. Any help or insight into what I'm doing wrong would be greatly appreciated. In my CodePen pen I have a comment and example in the code block of what I want, and then the problem code is below that. The actual code is in the light gray area above the code block: https://codepen.io/jim-kernicky/pen/xxJrwXz
1 Reply
Kernix
Kernix2y ago
Never mind, I was using the wrong regular expression - they all look like Chinese to me.
Want results from more Discord servers?
Add your server