-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rich Text: Indicate which text will be turned into a link (#8807)
* Rich Text: Indicate which text will be turned into a link When inserting a link, the text selection disappears when the focus changes into the URLInput text field. This makes it hard to tell which text will be turned into a link. The Classic Editor solves this by inserting a placeholder <a> element, which is the approach that we borrow here. * Add E2E tests for creating, editing and removing links * Use an `if` instead of a `switch` in getFormatValue() A `switch` is overkill when there's only one format value that acts differently. * Rename Link E2E tests Renames managing-links → links and makes the test descriptions read like English sentences.
- Loading branch information
1 parent
87780df
commit 4a184d5
Showing
5 changed files
with
404 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Links can be created by selecting text and clicking Link 1`] = ` | ||
"<!-- wp:paragraph --> | ||
<p>This is <a href=\\"https://wordpress.org/gutenberg\\">Gutenberg</a></p> | ||
<!-- /wp:paragraph -->" | ||
`; | ||
exports[`Links can be created by selecting text and using keyboard shortcuts 1`] = ` | ||
"<!-- wp:paragraph --> | ||
<p>This is <a href=\\"https://wordpress.org/gutenberg\\">Gutenberg</a></p> | ||
<!-- /wp:paragraph -->" | ||
`; | ||
exports[`Links can be created without any text selected 1`] = ` | ||
"<!-- wp:paragraph --> | ||
<p>This is Gutenberg: <a href=\\"https://wordpress.org/gutenberg\\">https://wordpress.org/gutenberg</a></p> | ||
<!-- /wp:paragraph -->" | ||
`; | ||
exports[`Links can be edited 1`] = ` | ||
"<!-- wp:paragraph --> | ||
<p>This is <a href=\\"https://wordpress.org/gutenberg/handbook\\">Gutenberg</a></p> | ||
<!-- /wp:paragraph -->" | ||
`; | ||
exports[`Links can be removed 1`] = ` | ||
"<!-- wp:paragraph --> | ||
<p>This is Gutenberg</p> | ||
<!-- /wp:paragraph -->" | ||
`; |
Oops, something went wrong.