Skip to content

Commit 847b827

Browse files
authored
Merge pull request #73 from brainhack-vandy/david-image-html-regex
David image html regex
2 parents 834abe0 + 0ccbd65 commit 847b827

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/data/data_utils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,23 @@ function processIssues(issues) {
3636

3737
// Regular expressions
3838
const linkRegex = /### Link to project repository\/sources([\s\S]*?)###/;
39-
const imageRegex = /### Image!\[.*?\]\((.*?)\)/;
39+
const imageRegex = /### Image\s*!\[.*?\]\((.*?)\)/;
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)