updated image tag handling to support multi-line tags
This commit is contained in:
parent
79a27ae368
commit
6819d100d3
2 changed files with 10 additions and 6 deletions
4
index.js
4
index.js
|
|
@ -133,9 +133,9 @@ export default async function now() {
|
||||||
`$1${latest.image}$2`,
|
`$1${latest.image}$2`,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
// remove img tags if no image available
|
// remove img tags if no image available (handle multi-line tags)
|
||||||
newNow = newNow.replace(
|
newNow = newNow.replace(
|
||||||
new RegExp(`<img[^>]+src=["']${imageId}["'][^>]*>`, 'gi'),
|
new RegExp(`<img[^>]*src=["']${imageId}["'][^>]*>`, 'gis'),
|
||||||
'',
|
'',
|
||||||
)
|
)
|
||||||
// remove markdown image
|
// remove markdown image
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@
|
||||||
|
|
||||||
<div style="display: flex; flex-direction: column; gap: 0.75rem;">
|
<div style="display: flex; flex-direction: column; gap: 0.75rem;">
|
||||||
<div style="background: rgba(166, 227, 161, 0.15); padding: 1rem; border: 4px solid #a6e3a1; color:white;">
|
<div style="background: rgba(166, 227, 161, 0.15); padding: 1rem; border: 4px solid #a6e3a1; color:white;">
|
||||||
|
<div style="text-align: left;">
|
||||||
<i class="fa-brands fa-lastfm"></i> I listened to this<br>
|
<i class="fa-brands fa-lastfm"></i> I listened to this<br>
|
||||||
<a href="https://www.last.fm/user/lookathimthere" style="color: #a6e3a1 !important;">lastfm</a>
|
<a href="https://www.last.fm/user/lookathimthere" style="color: #a6e3a1 !important;">lastfm</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div
|
<div
|
||||||
style="background: rgba(250, 179, 135, 0.15); padding: 1rem; border: 4px solid #fab387; color:white; display: flex; justify-content: space-between; align-items: center;">
|
style="background: rgba(250, 179, 135, 0.15); padding: 1rem; border: 4px solid #fab387; color:white; display: flex; justify-content: space-between; align-items: center;">
|
||||||
<div style="text-align: left;">
|
<div style="text-align: left;">
|
||||||
|
|
@ -65,9 +67,11 @@
|
||||||
<img src="weblog-image" style="max-width: 120px; max-height: 120px; object-fit: cover; border-radius: 4px;">
|
<img src="weblog-image" style="max-width: 120px; max-height: 120px; object-fit: cover; border-radius: 4px;">
|
||||||
</div>
|
</div>
|
||||||
<div style="background: rgba(137, 220, 235, 0.15); padding: 1rem; border: 4px solid #89dceb; color:white;">
|
<div style="background: rgba(137, 220, 235, 0.15); padding: 1rem; border: 4px solid #89dceb; color:white;">
|
||||||
|
<div style="text-align: left;">
|
||||||
<i class="fa-solid fa-code"></i> I pushed some (bad) code<br>
|
<i class="fa-solid fa-code"></i> I pushed some (bad) code<br>
|
||||||
<a href="https://source.tube/dylan" style="color: #89dceb !important;">source.tube</a>
|
<a href="https://source.tube/dylan" style="color: #89dceb !important;">source.tube</a>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5>{last-updated}</h5>
|
<h5>{last-updated}</h5>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue