Editor Stripping Tags

Jun 22, 2013 at 5:34 PM
Edited Jun 22, 2013 at 5:36 PM
I am trying to add a textarea control to my blog post, but the post keeps stripping-out the textarea tags. What I want to do is put code on the page that a user can copy to embed a graphic from my site on their own sites. Even when I try to add the code through the HTML-only modes it strips them out.
<h4>Embed this infographic on any page.</h4>
<code><br />
  <textarea rows="4" style="width:560px;" onClick="select();" class="embed-share">
    <a href="http://www.cheatsheetwarroom.com/blog/post/standard-fantasy-football-scoring-system.aspx/">
      <img src="http://www.cheatsheetwarroom.com/blog/images/standard-scoring-full-size.jpg" 
        alt="The Standard Fantasy Football Scoring System Point Chart - Infographic" title="The Standard Fantasy Football Scoring System Point Chart - Infographic" width="400" height="1688" /></a>
    <br/>
    <a href="http://www.cheatsheetwarroom.com">Cheat Sheet War Room</a>
  </textarea>
<br />
</code>
Any way to do this?
Coordinator
Jun 22, 2013 at 6:22 PM
If you want people just be able copy this code, why not publish it as a code using "code" button in the admin text editor, similar to what you did here?
Jun 24, 2013 at 1:52 AM
Edited Jun 24, 2013 at 1:55 AM
Well the idea putting it in a textbox is that the user can click on the textbox and easily copy all of its contents. This isn't quite as intuitive when it is a block of test.

Not only that, I don't want them to copy the [code] tags but they appear by default and if I don't see them then it look looks like test.
Jun 24, 2013 at 2:19 AM
Edited Jun 24, 2013 at 12:18 PM
The editor in BlogEngine is from TinyMCE, it routinely strips out all manner of tags, but you can tell it not to.
This issue has come up a couple of times before for different tags, but the process should be the same.

Googling "tinymce stripping out tags" results in quite a few useful suggestions also.

Update:
Was actually a little curious as to how this would work in practice(textarea within a textarea) but it does.
Tried it on a fresh copy of BE2.8 without modifying anything, copy and paste the following into the HTML Source Editor.
<div><textarea class="embed-share" onclick="select();" rows="4"> &lt;a href="http://www.cheatsheetwarroom.com/blog/post/standard-fantasy-football-scoring-system.aspx/"&gt;
      &lt;img src="http://www.cheatsheetwarroom.com/blog/images/standard-scoring-full-size.jpg" 
        alt="The Standard Fantasy Football Scoring System Point Chart - Infographic" title="The Standard Fantasy Football Scoring System Point Chart - Infographic" width="400" height="1688" /&gt;&lt;/a&gt;
    &lt;br/&gt;
    &lt;a href="http://www.cheatsheetwarroom.com"&gt;Cheat Sheet War Room&lt;/a&gt;

</textarea></div>
Coordinator
Jun 24, 2013 at 4:50 PM
I was talking about built-in code editor with syntax highlighter. For example on this post you can double-click any code block you want to copy (I believe you can also show "copy" menu if double-click is not intuitive enough).
Jun 29, 2013 at 11:16 PM
Thanks to both of you guys. Andy your solution worked perfect for squeezing it into a tiny area. Much appreciated.