tneotia/html-editor-enhanced

[QUESTION] Link opening

JEuler opened this issue · 8 comments

Is there any possibility to manually specify how to open the links? It is an opening the link on the same page where the editor is opened for now.

As of right now the library does not have this feature but it is not difficult to implement. I will try to add this today or tomorrow, and once it's done I will post an example for you :)

Thank you very much! 🍻

@JEuler added this to the library. You can use a git dependency on 2.2.0+1-dev.1 and implement like this:

callbacks: Callbacks(
   onNavigationRequestMobile: (String url) {
      print(url);
      return NavigationActionPolicy.ALLOW;
   },
)

NavigationActionPolicy.CANCEL if you want to stop the URL from loading in the webview. Hope it helps :)

It is working, thank you very much! :)

Thanks for the confirmation. If you have any other questions let me know!

I can't implement onNavigationRequestMobile. I'm using dependency on 2.2.0+1-dev.1 but no callback function is onNavigationRequestMobile. @tneotia Can you help me?

@tranglt-64 try to use the GIT reference

  html_editor_enhanced:
    git:
      url: https://github.com/tneotia/html-editor-enhanced.git
      ref: 2.2.0+1-dev.1

if i enter any link and click spacebar or any normal text then the link is not show as link it display as a text