hnakamur / FormatLink-Firefox

A Firefox web-extension to copy the URL and the title or the selected text to clipboard
https://addons.mozilla.org/ja/firefox/addon/format-link3/
MIT License
45 stars 8 forks source link

not working properly in Wordpress TinyMCE editor #22

Closed atomGit closed 4 years ago

atomGit commented 6 years ago

Waterfox 56.2.3 GNU/Linux

with Easy Copy, when copying a page URL and title as HTML and pasting it into the visual TinyMCE editor in Wordpress, the string is pasted as a hyperlink

with Format Link however, the string is pasted raw (<a href="blah">this</a>) and is not linked

the template for Easy Copy: <a href="%url%">%title%</a> the template for Format Link: <a href="{{url.s("\"","&quot;")}}">{{text.s("<","&lt;")}}</a>

i have messed around with the Format Link template, removing the RegExp stuff and simplifying it, etc., but i can't get it to paste a hyperlink in the TinyMCE editor (visual)

hnakamur commented 6 years ago

Format Link currently copies a URL in text/plain format. Maybe TinyMCE need a hyperlink in text/html format.

You can try asamuzaK/url2clipboard: Copy document URL / link URL to clipboard as HTML, Markdown, BBCode, Text, etc. with setting the copy format to text/html as said in https://github.com/hnakamur/FormatLink-Firefox/pull/17#issuecomment-347476765

atomGit commented 4 years ago

i'd like to ask that this issue be revisited and that pasting as mime type text/html be considered - this is very useful for pasting in the wordpress visual editor, but also possibly on any other platform that uses a visual editor which allows html

hnakamur commented 4 years ago

Sorry for not announcing here but the latest version of this extension supports pasting as HTML. You can use it by updating to the latest version and check HTML checkbox for a format in the options page.

I don't know why but it does not work sometimes. In that case, it works after retrying a couple of times.