feat: Merge pull request #140 from samuele-cozzi:139-external-images-dont-appear-in-deck-preview

external images
This commit is contained in:
samuele-cozzi 2024-01-31 23:00:11 +01:00 committed by GitHub
commit 43e829fe4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View file

@ -130,7 +130,7 @@ export class MarpPreviewView extends ItemView {
let { html, css } = this.marp.render(markdownText);
// Replace Backgorund Url for images
html = html.replace(/background-image:url\("/g, `background-image:url("${basePath}`);
html = html.replace(/(?!background-image:url\("http)background-image:url\("/g, `background-image:url("${basePath}`);
const htmlFile = `
<!DOCTYPE html>

View file

@ -43,6 +43,17 @@ text
---
<!-- _class: divider -->
### Introduction
text
![bg right:33%](https://t3.ftcdn.net/jpg/02/48/42/64/360_F_248426448_NVKLywWqArG2ADUxDq6QprtIzsF82dMF.jpg)
---
<!-- _class: divider -->
## Section Header