-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update HTML anchor explaination text #16142
Merged
Merged
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ad4b2cb
Update HTML anchor explaination text
melchoyce 075cda4
Update "learn more" class name to fit the component
melchoyce 94d3ccb
Wrap sentence in paragraph to inherit the correct styles
melchoyce 1c3f9df
Fix indentation issues
melchoyce ae2b1c7
Fix "you'll" parsing error
melchoyce a8dfefb
Change div to p
melchoyce 634221d
Update packages/block-editor/src/hooks/anchor.js
melchoyce 22cd081
Update packages/block-editor/src/hooks/anchor.js
melchoyce a77fe87
Added stylesheet for anchor.
tellthemachines aec4d12
Update link.
tellthemachines 3bafcf8
No need to localise link URLs
noisysocks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ import { assign, has } from 'lodash'; | |
* WordPress dependencies | ||
*/ | ||
import { addFilter } from '@wordpress/hooks'; | ||
import { TextControl } from '@wordpress/components'; | ||
import { TextControl, ExternalLink } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
import { hasBlockSupport } from '@wordpress/blocks'; | ||
import { createHigherOrderComponent } from '@wordpress/compose'; | ||
|
@@ -71,7 +71,18 @@ export const withInspectorControl = createHigherOrderComponent( ( BlockEdit ) => | |
<InspectorAdvancedControls> | ||
<TextControl | ||
label={ __( 'HTML Anchor' ) } | ||
help={ __( 'Anchors lets you link directly to a section on a page.' ) } | ||
help={ ( | ||
<> | ||
<p> | ||
{ __( 'Enter a word or two — without spaces — to make a unique web address just for this heading, called an "anchor." Then, you\'ll be able link directly to this section of your page.' ) } | ||
melchoyce marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</p> | ||
<p className="components-base-control__learn-more"> | ||
melchoyce marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<ExternalLink href={ __( 'https://wordpress.org/support/article/#/' ) }> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This URL doesn't go anywhere useful. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to sub it in for https://wordpress.org/support/article/page-jumps/ now that the page exists |
||
{ __( 'Learn more about anchors' ) } | ||
</ExternalLink> | ||
</p> | ||
</> | ||
) } | ||
value={ props.attributes.anchor || '' } | ||
onChange={ ( nextValue ) => { | ||
nextValue = nextValue.replace( ANCHOR_REGEX, '-' ); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love the idea of adding extra markup in order to style the component. It's not a huge amount of work to create a stylesheet for this section (and I volunteer to do it myself if needed), is there any good reason not to though?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to have a play and push to this branch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!