Skip to content

Commit cb09fcd

Browse files
David ZahaDavid Zaha
authored andcommitted
added html regex for images
1 parent 834abe0 commit cb09fcd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/data/data_utils.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,22 @@ function processIssues(issues) {
3737
// Regular expressions
3838
const linkRegex = /### Link to project repository\/sources([\s\S]*?)###/;
3939
const imageRegex = /### Image!\[.*?\]\((.*?)\)/;
40+
const iamgeHTMLRegex = /<img[^>]*src="(.*?)"/;
41+
4042
const descriptionRegex = /### Project Summary([\s\S]*?)###/;
4143

4244
const titleRegex = /### Title([\s\S]*?)###/;
4345

4446
// Extract image link
4547
const imageMatch = imageRegex.exec(body);
48+
const imageHTMLMatch = iamgeHTMLRegex.exec(body);
49+
4650
if (imageMatch) {
4751
imageLink = imageMatch[1].trim(); // The URL is in the second capturing
4852
}
53+
else if (imageHTMLMatch) {
54+
imageLink = imageHTMLMatch[1].trim();
55+
}
4956

5057
// Extract info link
5158
const linkMatch = linkRegex.exec(body);

0 commit comments

Comments
 (0)