This repository was archived by the owner on Feb 6, 2023. It is now read-only.
Commit 862a5b2
fix pasting invalid links
Summary:
I got a bug report today where someone was trying to copy/paste some content and nothing happened at all. I discovered that this was due to a bad link in her content, something like this:
```
<a href="https:// https://www.facebook.com">Faceboook</a>
```
In Chrome, this passes all the checks in `isValidAnchor`, but throws an error later on this line inside `_addAnchorNode`:
```
entityConfig.url = new URI(anchor.href).toString();
```
To account for this, I added an explicit `URI.tryParseURI` inside `isValidAnchor`.
Reviewed By: claudiopro
Differential Revision: D22601322
fbshipit-source-id: 61cf050bb6e4a31bbe95995ad3f57e8f39a1d9541 parent fc9395f commit 862a5b2
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
165 | | - | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
0 commit comments