Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix linkContentMatchHref issues (#21)
* Fix an issue that a protocol-less url is linkified as a relative URL When a user enters `www.example.com` and hits the space key, the text should be linkified as `<a href="http://www.example.com">www.example.com</a>`. However the text was linkified as `<a href="www.example.com">www.example.com</a>`. This doesn't happen in Squire, however `syncLinkHrefWithContent` didn't seem to take into account the case when the text content doesn't have a protocol part. Here's another somewhat related case. When a user enters `http://www.example.com` and hits the space key, the text is linkified as `<a href="http://www.example.com">www.example.com</a>` which is good. Then they place a cursor after `http://` and delete `://`, the href should be updated with `href="http://httpwww.example.com"`. However the actual behavior was that the href was updated with `href="httpwww.example.com"`. An expected behavior in this case may be controvertible, but generating a relative link doesn't seem to make sense. #15 * fix: improve syncLinkHrefWithContent * chore: add some comments Co-authored-by: Satoshi Tanimoto <[email protected]>
- Loading branch information