Skip to content

Commit

Permalink
feat: 1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
lijunchang committed Dec 7, 2023
1 parent 5ea247b commit c5e99ad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
13 changes: 10 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
## 1.0.3 - 2023-12-07

### Bug Fixes

* Remove leading and trailing whitespace


## 1.0.2 - 2023-12-06

### Bug Fixes

* use xlink:href additionally to href in img
* Use xlink:href additionally to href in img


## 1.0.1 - 2023-12-06

### Features

* Update document
* Update README


## 1.0.0 - 2023-12-06
Expand All @@ -20,4 +27,4 @@

### Bug Fixes

* Safari returns 2 DOMRects when wrapping text.
* Safari returns 2 DOMRects when wrapping text
3 changes: 3 additions & 0 deletions lib/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ export function handleTextNode(textNode: Text, context: TraversalContext): void
// Make sure the y attribute is the bottom of the box, not the baseline
svgTextElement.setAttribute('dominant-baseline', 'text-after-edge')

// Remove leading and trailing whitespace
textNode.textContent = textNode.textContent!.trim()

const lineRange = textNode.ownerDocument.createRange()
lineRange.setStart(textNode, 0)
lineRange.setEnd(textNode, 0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "dom2svg",
"type": "module",
"version": "1.0.2",
"version": "1.0.3",
"description": "Take SVG screenshots of DOM elements",
"author": "xiashui",
"license": "MIT",
Expand Down

0 comments on commit c5e99ad

Please sign in to comment.