-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Expect autoformat delimiters to have a space character preceding them. #8619
Conversation
e11301f
to
5c59f79
Compare
@@ -80,17 +80,17 @@ export default class Autoformat extends Plugin { | |||
if ( commands.get( 'bold' ) ) { | |||
const boldCallback = getCallbackFunctionForInlineAutoformat( this.editor, 'bold' ); | |||
|
|||
inlineAutoformatEditing( this.editor, this, /(\*\*)([^*]+)(\*\*)$/g, boldCallback ); | |||
inlineAutoformatEditing( this.editor, this, /(__)([^_]+)(__)$/g, boldCallback ); | |||
inlineAutoformatEditing( this.editor, this, /(?:^|\s)(\*\*)([^*]+)(\*\*)$/g, boldCallback ); |
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.
Could add a comment explaining why I added this here. Not sure if that's necessary.
@@ -577,24 +613,24 @@ describe( 'Autoformat', () => { | |||
|
|||
describe( 'should format', () => { | |||
it( '* after', () => { | |||
setData( model, '<paragraph><$text code="true">fo*o</$text>b*ar[]</paragraph>' ); | |||
setData( model, '<paragraph><$text code="true">fo*o</$text>b *ar[]</paragraph>' ); |
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've changed the test to let it format according to PR changes.
All looks fine, but it'd be good to have a clarity on cases that you ignored and that will become possible followups. Some that I can think of:
What else did you skip? It'd be good to have tickets for these scenarios. |
Suggested merge commit message (convention)
Fix (autoformat): Formatting will not be applied to
snake_case_scenario
anymore. Closes #2388.