clipboard.js with html.erb to be copied to clipboard

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

clipboard.js with html.erb to be copied to clipboard

fugee ohu
I'm trying to implement clipboard.js It works if i put a simple text string inside the <pre class="prettyprint" id='script-tag'>...</pre> containers but if I put the html shown below it copies only newline and whitespace characters to the clipboard
<pre class="prettyprint" id='script-tag'>
<a href=https://ignatzmouse.com/<%= current_user.name %>/page>
<image src=https://sn.com/follow-me-on-sn.png>
</a>
</pre>


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1f6a75f-a380-44af-a7fd-2fd2c12d7f18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: clipboard.js with html.erb to be copied to clipboard

Rob Zolkos-2
Is the Ruby on Rails list the best place to ask this question?

On Sun, Feb 10, 2019 at 6:45 PM fugee ohu <[hidden email]> wrote:
I'm trying to implement clipboard.js It works if i put a simple text string inside the <pre class="prettyprint" id='script-tag'>...</pre> containers but if I put the html shown below it copies only newline and whitespace characters to the clipboard
<pre class="prettyprint" id='script-tag'>
</a>
</pre>


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c1f6a75f-a380-44af-a7fd-2fd2c12d7f18%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAJ6MPzJbnq3xBByoh_7xaMOLyGCJja6Wp%3DyjKFUgCOU8GGDp6A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: clipboard.js with html.erb to be copied to clipboard

fugee ohu
In reply to this post by fugee ohu


On Sunday, February 10, 2019 at 3:44:51 AM UTC-5, fugee ohu wrote:
I'm trying to implement clipboard.js It works if i put a simple text string inside the <pre class="prettyprint" id='script-tag'>...</pre> containers but if I put the html shown below it copies only newline and whitespace characters to the clipboard
<pre class="prettyprint" id='script-tag'>
<a href=<a href="https://ignatzmouse.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fignatzmouse.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_qagmbY2HjcBa7mdetqcBYqKrVg&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fignatzmouse.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG_qagmbY2HjcBa7mdetqcBYqKrVg&#39;;return true;">https://ignatzmouse.com/<%= <a href="http://current_user.name" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcurrent_user.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE4EF1iVjJ56O6ix_8r1Yt8ofi1NQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fcurrent_user.name\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE4EF1iVjJ56O6ix_8r1Yt8ofi1NQ&#39;;return true;">current_user.name %>/page>
<image src=<a href="https://sn.com/follow-me-on-sn.png" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsn.com%2Ffollow-me-on-sn.png\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGUmb7XscmnsGQg11vO9ajpwdV9-A&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fsn.com%2Ffollow-me-on-sn.png\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGUmb7XscmnsGQg11vO9ajpwdV9-A&#39;;return true;">https://sn.com/follow-me-on-sn.png>
</a>
</pre>



Works after changing <pre> to <textarea>

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a07eb5b7-7fdd-4bf0-b57e-cae9de258180%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.