Skip to content
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

fix: newline behavior for heading and paragraphs tags #8060

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

atarek12
Copy link

Related Ticket: #8040

Description of Changes:

  • Enabling the Enter key to insert line-break for inline editors.
  • I have forced the behavior to be line-break for the inline editors whenever we have P and h* tags as root blocks as we cannot insert the Block break inside them.

Pre-checks:

  • Changelog entry added
  • Tests have been added (if applicable)
  • Branch prefixed with feature/, hotfix/ or spike/

Review:

  • Milestone set
  • Docs ticket created (if applicable)

GitHub issues (if applicable): #8040

@atarek12 atarek12 requested a review from a team as a code owner August 19, 2022 00:12
@atarek12
Copy link
Author

atarek12 commented Sep 2, 2022

@TheSpyder @spocke any updates for this PR?

@TheSpyder
Copy link
Member

Apologies for the lack of follow up on this. We're scheduled to look at it soon. I'm not sure whether your PR is the right approach; I was suspecting something in the invert logic might be wrong, or perhaps ContextSelectors.shouldInsertBr() should also match the inline root block.

If it is the right approach I'd want to adjust the logic to use an existing defined list of blocks rather than hard coding extra ones after summary, but that's not a simple task.

const blocks = [
'article', 'aside', 'details', 'div', 'dt', 'figcaption', 'footer',
'form', 'fieldset', 'header', 'hgroup', 'html', 'main', 'nav',
'section', 'summary', 'body', 'p', 'dl', 'multicol', 'dd', 'figure',
'address', 'center', 'blockquote', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
'listing', 'xmp', 'pre', 'plaintext', 'menu', 'dir', 'ul', 'ol', 'li', 'hr',
'table', 'tbody', 'thead', 'tfoot', 'th', 'tr', 'td', 'caption'
];

@lgtm-com
Copy link

lgtm-com bot commented Nov 6, 2022

This pull request introduces 1 alert when merging 8db5d42 into a32f926 - view on LGTM.com

new alerts:

  • 1 for Syntax error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants