Skip to content

Commit

Permalink
Merge pull request #76 from reedrolemodel/patch-1
Browse files Browse the repository at this point in the history
Node#visible_text use scrub to replace invalid UTF-8 sequences
  • Loading branch information
YusukeIwaki authored Sep 28, 2024
2 parents b1c38b6 + b81a5f9 commit 0d8b37f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/capybara/playwright/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def visible_text
}
}
JAVASCRIPT
text.to_s.gsub(/\A[[:space:]&&[^\u00a0]]+/, '')
text.to_s.scrub.gsub(/\A[[:space:]&&[^\u00a0]]+/, '')
.gsub(/[[:space:]&&[^\u00a0]]+\z/, '')
.gsub(/\n+/, "\n")
.tr("\u00a0", ' ')
Expand Down

0 comments on commit 0d8b37f

Please sign in to comment.