Skip to content

Commit

Permalink
docs: Fix integrity hash generator missing closing double quote, upda…
Browse files Browse the repository at this point in the history
…te current integrity hash
  • Loading branch information
jdecked committed Mar 21, 2024
1 parent db476f0 commit 5c70264
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This guarantees that you will always use the latest version of the library.

If, instead, you'd like to include the latest version explicitly, you can add the following tag:
```html
<script src="https://cdn.jsdelivr.net/npm/@twemoji/api@15.0.2/dist/twemoji.min.js integrity="sha384-GWrfUNp6XiceGqVNiGL6eWR/731mM4Dhg3nur6EJGcYZKVZh8pIGXkMhO5XqjFRl" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/@twemoji/api@15.0.2/dist/twemoji.min.js" integrity="sha384-D6GSzpW7fMH86ilu73eB95ipkfeXcMPoOGVst/L04yqSSe+RTUY0jXcuEIZk0wrT" crossorigin="anonymous"></script>
```

### Download
Expand Down
2 changes: 1 addition & 1 deletion scripts/create-dist
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const integrityHash = getIntegrityHash(distFile('twemoji.min.js'));
const { version } = require('../package.json');

function updateSriScriptReference(filename) {
const newScript = `<script src="https://cdn.jsdelivr.net/npm/@twemoji/api@${version}/dist/twemoji.min.js integrity="${integrityHash}"`;
const newScript = `<script src="https://cdn.jsdelivr.net/npm/@twemoji/api@${version}/dist/twemoji.min.js" integrity="${integrityHash}"`;
fs.writeFileSync(filename, fs.readFileSync(filename).toString('utf8').replace(/<script src="[^ ]*" integrity="[^ ]*"/, newScript));
}

Expand Down

0 comments on commit 5c70264

Please sign in to comment.