Skip to content

Conversation

@maxpeterson
Copy link

Thanks for providing a great library @jpuri

I needed the ability to validate the links so I have created this PR to add config options to validate the urls input for Link and Embedded

  • Add linkValidator config options to provide functions to validate Link target
  • Adds valid/invalid classes to Link modal title and target
  • Disable Add Link button when not target valid
  • Add embedValidator config options to provide functions to validate Embedded url
  • Adds valid/invalid classes to Embedded modal link, width and height
  • Disable Add Embedded button when link not valid

This is partly based on #355, however it does not provide "allowRelative" link functionality nor prepends links with 'https://'. Both should be possible with a combination of the new linkValidator and the existing linkCallback

Possibly related to #483

heightValid,
widthValid,
} = this.state;
console.log('heightValid', heightValid);

Choose a reason for hiding this comment

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

Log should be removed

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in 7f61272

" component: undefined,\n" +
" popupClassName: undefined,\n" +
" embedCallback: undefined,\n" +
" embedValidator: undefined,\n" +

Choose a reason for hiding this comment

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

linkValidator field is missing in this file

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in 7f61272

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.

2 participants