canner-slate-editor icon indicating copy to clipboard operation
canner-slate-editor copied to clipboard

Links not working

Open aladagemre opened this issue 6 years ago • 9 comments

Extra Space Problem

I run the demo. When I manually type a link element, it is converted to a link. It's good. I only observe some extra spaces before the link text. This may need some fix.

Pasting link in markdown breaks further links.

When I pasted the following:

[example](http://example.com "Optional title")[space]

It did not convert to a link. Then I tried to add similar links below this line and they did not convert to a link either.

However when I try to manually type a link to another position (away from the pasted string) in the document, it is converted to link properly.

Editing Links

One more thing: can we edit existing links by putting cursor over the link?

aladagemre avatar May 04 '18 15:05 aladagemre

@aladagemre I can't repoduce

  • Extra Space Problem
  • Pasting link in markdown breaks further links.

in the latest demo. Please check if the bug is still there https://canner.github.io/canner-slate-editor.

As for Editing Links I've added, remove button when hovering links. Will soon add an edit button!

chilijung avatar Sep 06 '18 10:09 chilijung

Hi, now I can not even type on the editor. Only Enter and backspace buttons work. Tested with Chrome and Firefox on MacOS. I'm not sure why.

aladagemre avatar Sep 06 '18 11:09 aladagemre

Oh, wait a sec! The demo I upload is broken, sorry!

chilijung avatar Sep 06 '18 11:09 chilijung

fixed! Please try thanks!

chilijung avatar Sep 06 '18 11:09 chilijung

Now I can say

  • We have to add press space after link statement in order to get it converted to link. Pressing Enter does not convert to link.
  • Spaces before the link remains.
  • Pasting markdown link does not convert to link (need to press space after pasting) but does not break further manual links anymore. ezgif com-video-to-gif

aladagemre avatar Sep 06 '18 11:09 aladagemre

Oh, got it, I misunderstood your problems! Thanks for reporting it, I'll update fixes tomorrow thanks!

chilijung avatar Sep 06 '18 11:09 chilijung

Hi @aladagemre, trailing spaces is fixed in v1.5.1. 🎉

Pasting markdown link does not convert to link (need to press space after pasting).

I think pasting markdown links shouldn't convert to links since we have implemented copy & paste HTML(It will automatically serialize into the editor) in our editors.

We have to add press space after link statement in order to get it converted to link. Pressing Enter does not convert to link.

I am thinking about this, for inline styles we listened to entering spaces to parse the line whether it matched certain rules (and most editors does the same way). But still a good idea. I've checked Wordpress's editor, it only supports converting blocks (List, Header, etc...) when pressing enter.

chilijung avatar Sep 07 '18 10:09 chilijung

Thanks! Now space problem is fixed!

The only problem with pasting markdown links is when you type your markdown file in your desktop editor like Atom / Sublime (without HTML rendering) and then paste it here. What could be done is to figure out whether the pasted text contains HTML or plain markdown syntax and act accordingly. That would be another improvement task.

aladagemre avatar Sep 07 '18 10:09 aladagemre

Sounds pretty useful! I'll think whether it is possible to implement it! 😄

chilijung avatar Sep 07 '18 10:09 chilijung