Skip to content

Commit

Permalink
fix: desca[e and removeQuotes did not worked together right
Browse files Browse the repository at this point in the history
  • Loading branch information
yhdgms1 committed Mar 7, 2022
1 parent 5fe9201 commit 6d5ee24
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Use SVG foreignObject to render images of HTML content",
"author": "Artem Schukin",
"license": "MIT",
"version": "0.5.1",
"version": "0.5.2",
"type": "module",
"homepage": "https://github.com/Artemis69/svg-foreignobject-screenshot",
"repository": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getImageUrlsFromHtml, getUrlsFromCss, descape } from './lib'
import { getImageUrlsFromHtml, getUrlsFromCss, descape, removeQuotes } from './lib'
import { Options, HookName, HookParameter, BuildSvgDataURI } from './types'
export { fetcher } from './fetcher'

Expand All @@ -12,7 +12,7 @@ const useFetcher = async (resources: string[], fetcher: Options['fetcher']) => {
const results = [] as Array<[string, string]>

for (const resource of resources) {
const result = await fetcher(descape(resource))
const result = await fetcher(removeQuotes(descape(resource)))
results.push([resource, result])
}

Expand Down
4 changes: 4 additions & 0 deletions tests/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,8 @@ test('isDataUrl', () => {
assert.is(isDataUrl('#path'), true)
})

test('descape and removeQuotes combined', () => {
assert.is(removeQuotes(descape('&quot;stars.jpg&quot;')), 'stars.jpg')
})

test.run()

0 comments on commit 6d5ee24

Please sign in to comment.