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

[EuiMarkdownEditor] Add a markdown link validator #4362

Merged
merged 5 commits into from
Dec 9, 2020

Conversation

glitteringkatie
Copy link
Contributor

@glitteringkatie glitteringkatie commented Dec 7, 2020

Summary

Closes #4331

markdown parsing

https://eui.elastic.co/pr_4362/#/editors-syntax/markdown-editor

Look how only the valid urls get rendered as links, and the rest render their text. Ooooh. Ahhhh. Valid markdown links start with http:/https: or a forward slash.

validate-url

href validation

https://eui.elastic.co/pr_4362/#/navigation/link#link-validation

EuiLink docs updated with a section on the validation. I [Chandler] initially planned on creating a new prop to disable the validation, but with React planning on similarly removing this functionality I'm going to be optimistic that no one will miss having this option available. In contrast to markdown's validation which only allows a small approved list of url patterns, the href validation only prevents javascript:.

Screen Shot 2020-12-08 at 12 42 19 PM

Components affected:

  • EuiLink
  • EuiBadge
  • EuiBreadcrumb (fowards to EuiLink)
  • EuiButton
  • EuiButtonEmpty
  • EuiButtonIcon
  • EuiCard
  • EuiContextMenuItem
  • EuiHeaderLogo
  • EuiKeyPadMenuItem
  • EuiListGroupItem
  • EuiSideNavItem
  • EuiTab
  • EuiControlBar (forwards to EuiButton)
  • EuiPaginationButton (fowards to EuiButtonEmpty)

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in Chrome, Safari, Edge, and Firefox
- [ ] Props have proper autodocs
- [ ] Added documentation
- [ ] Checked Code Sandbox works for the any docs examples

  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4362/

@chandlerprall chandlerprall changed the title Add a markdown link validator [EuiMarkdownEditor] Add a markdown link validator Dec 8, 2020
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4362/

@chandlerprall chandlerprall marked this pull request as ready for review December 8, 2020 21:37
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4362/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM. Don't forget a changelog entry

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4362/

@chandlerprall chandlerprall merged commit 0031003 into elastic:master Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiMarkdownEditor] href validation
4 participants