-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiMarkdownEditor] Add remark-breaks
and line break plugin
#5272
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_5272/ |
Thanks @i-a-n for opening this PR, I also don't see this as a breaking change and we're saying since day one that the markdown editor "uses GitHub flavored markdown". So I guess this behavior should be expected. For allowing to opt-out the plugin you can see how @chandlerprall did it here: elizabetdev/eui@90a669a#diff-d5fec82a5af6bfbe83ee2cee3b7aad4e015f98f57996b8f8eb703a14688efbc0R74. And we should say in our docs that we can unregister this plugin in the following section: And update the following demo to show how we can also unregister the line break plugin: All the rest looks good to me! 👍🏽 |
thanks for taking a look @miukimiu . I was going deeper into this one and found a few things:
I think this leaves us with a few directions we can go in, and perhaps I'll leave it up to you & the team which is the best option:
let me know what you think! happy to help with whatever the team decides. |
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.
These changes LGTM;
Since we target github flavor markdown, adding this feels more like a bug fix than what we'd consider a breaking change, and with that inclusion I'd consider this a non-disableable plugin, as opposed to our addition of tooltip to the markdown syntax (option 1 in #5272 (comment)).
Preview documentation changes for this PR: https://eui.elastic.co/pr_5272/ |
…c#5272) * Add remark-breaks and line break plugin to MarkdownEditor * Update changelog
…c#5272) * Add remark-breaks and line break plugin to MarkdownEditor * Update changelog
* Provide rows for datagrid cells to be owned by * changelog * undoing things * working except virtualized container * working row wrapper implementation * Create datagrid row elements on-demand and render cells via portals * Provide rows for datagrid cells to be owned by * changelog * undoing things * working except virtualized container * working row wrapper implementation * Create datagrid row elements on-demand and render cells via portals * Small style cleanup * updated changelog * fixing a bad changelog merge * oh that style was important * Update src/components/datagrid/body/data_grid_row_manager.ts Co-authored-by: Constance <constancecchen@users.noreply.github.com> * Update src/components/datagrid/data_grid_types.ts Co-authored-by: Constance <constancecchen@users.noreply.github.com> * Ensure unique ID in combobox with prepended or appended labels (#5229) * Making an explicit check for ID prop in EUI Combobox * Checking for a user-passed ID prop * If no user-passed ID, we'll use the `rootId()` class method to set one * Prepend and append props need an ID to relate label to the input * Adding example for Combobox with prepended label * Confirmed the label `for` attribute is referencing input `id` * Added styles to round the edges of the child `<div>` when we prepend a label * Bumped package.json * Adding CHANGELOG entry and bumping version * Update combo_box.tsx * Updating styles to match other forms with prepend and apppend. * Finishing Combobox CSS and test updates * Simplified the Amsterdam overrides for prepended / appended labels * Added conditional classes to `combo_box.tsx` * Added unit tests for user passed ID, prepended and appended classes * Reordering props in child component. * Final adjustment to ID check in ComboBox * Final updates to styling and documentation * Added CSS rules for compressed, prepend and append border radius * Updated the Display Toggles to include append * Removed a duplicated instruction paragraph * Simplified the logic for a unique ID in combobox.ts * Adding Combobox unique ID to master changelog * Updated Form Control Layout SCSS * The borders were still rounded with prepend and append enabled * Added two more rules to make borders square for full height and compressed * Move to _combo_box.scss Co-authored-by: cchaos <caroline.horn@elastic.co> * update i18ntokens * 40.0.0 * Updated documentation. * Add combined Jest+Cypress code coverage reports (#5262) * Install Cypress code coverage dependencies * Set up required babel+istanbul config * Set up Cypress code coverage config @see https://github.com/cypress-io/code-coverage#instrument-unit-tests * Add script for combining cypress & jest code coverage -into a single json & html report * Misc cleanup/ignores - Ignore new `.nyc_output` dir generated by cypress/istanbul - Improve Jest config collectCoverageFrom !ignores: - DRY out component+services folder patterns with a {,} glob - Ignore new Cypress .spec files and .testenv files for jest coverage - eslintignore the cypress folder, since they're all .js anyway and it has a decent amount of idiosyncracies + cleanup unused eslint-disable + cleanup cypress comment boilerplate + remove unused paths from webpack config * Add wiki documentation * [PR feedback] Move nyc config to own file * [PR feedback] Switch combine coverage script to .sh * [EuiMarkdownEditor] Add `remark-breaks` and line break plugin (#5272) * Add remark-breaks and line break plugin to MarkdownEditor * Update changelog * [Docs] Separated out Borders to its own page & [EuiTableRowCell] fixes (#5283) * Moved Border tokens to its own page * Figured out a way to get subsections in the sidenav working * Added the new `_values` under `customizing/` * [EuiTableRowCell] Actually support `valign` property manually * [EuiTable*] Fixing some props and mobile options * Slightly better responsive table styles * Fix CL from #5272 * [Docs] Update EuiDatePicker types (#5318) * omit unsupported types * resolve console errors * CL * [Cypress] Add flakey test retries + harden intermittent context menu failures (#5317) * Add Cypress failed test retries to CI run mode * Increase cy.wait on flaky context menu tests (just in case) * More hardening * [Docs] Fix Colors guidelines (#5316) * use useJsonVars * use variable * Update dependency @elastic/charts to ^38.1.0 (#5321) * PR feedback * Added a cypress test for datagrid row rendering * Revert changes(?) to docs/ * revert changelog reformats * re-ignore a couple datagrid example pages when running a11y tests * Alternate way to know if the datagrid cells have rendered * PR feedback * changelog Co-authored-by: Constance <constancecchen@users.noreply.github.com> Co-authored-by: Trevor Pierce <1Copenut@users.noreply.github.com> Co-authored-by: cchaos <caroline.horn@elastic.co> Co-authored-by: ian moersen <ian@union.io> Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com> Co-authored-by: Greg Thompson <thompson.glowe@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Summary
This adds the
remark-breaks
plugin to the default list of plugins for the MarkdownEditor. Now, unless disabled, all single-line linebreaks in the MarkdownEditor will translate to literal line breaks in thepreview
mode.Note that multiple consecutive line breaks will still result in only two line breaks, as it does today, so there are no concerns about runaway line breaks making things look weird. Behavior mimics GitHub's comment box.
Checklist
Resolves #5141
[Opening in Draft Mode since this is technically a change in behavior, and I'm not sure if this should be considerd a breaking change since the component is technically in Beta, so I'll be waiting for some feedback on that before merging.]