Skip to content

Commit

Permalink
πŸ“ Update sample code in README (#204)
Browse files Browse the repository at this point in the history
- fix: the given font example wasnt working
- fix: image converted to base64 should be printed into template unescaped
  • Loading branch information
Tiffceet committed Aug 5, 2023
1 parent c9f182e commit 5ac5bc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const dataURI = 'data:image/jpeg;base64,' + base64Image

nodeHtmlToImage({
output: './image.png',
html: '<html><body><img src="{{imageSource}}" /></body></html>',
html: '<html><body><img src="{{{imageSource}}}" /></body></html>',
content: { imageSource: dataURI }
})
```
Expand All @@ -186,7 +186,7 @@ const html = `
<style>
@font-face {
font-family: 'testFont';
src: url(${_data}) format('woff2'); // don't forget the format!
src: url("{{{_data}}}") format('woff2'); // don't forget the format!
}
</style>
</head>
Expand Down

0 comments on commit 5ac5bc8

Please sign in to comment.