BE stripping "illegal" parameters from tags?

Topics: ASP.NET 2.0, Controls
Sep 10, 2008 at 8:46 PM
I use the Amazon Associate program on my site.  One of the tools I use is the Quick Linker, which allows me to insert a tag like this:

<a type="amzn" search="led zeppelin" category="music">John Bonham</a>

into my page code, and it parses into a link taking the user to an amazon.com search for Led Zeppelin in the Music category.  Cool, right?

But...when I try to use this feature in my BE content, the links come back as:

<a type="amzn">John Bonham</a>

which syntax causes the user to be sent to Amazon searching for John Bonham, rather than Led Zeppelin, and without a category - in short, looking for books by or about John Bonham...which is a far smaller field of view with far less general interest than albums which feature him. 

At first I thought this was an error on the Amazon side - they've definitely had some issues of late with their developer/associate tools - but then I got the bright idea to try changing the links directly in the database.  Having done so, I reloaded the page that the content is to be displayed on and, lo and behold, I still have the stripped links.  Hmmm.

So I restarted my local server...and *now* it's showing the proper links.

I have to conclude that the page editor in the administration section of BE is 'stripping out' these 'illegal' parameters from the tag.  I would imagine that this is a security/quality control feature...but what I don't know is a) how to verify that and b) who to talk to about allowing the parameters "search," "category," and "asin" in <a> tags, rather than having them stripped out on post...and frankly, I am not close to knowing enough about ASP.Net to track the routines down and find them for myself.

Can anyone point me in the right direction?  Posting directly to the SQL server is a functionally effective approach, but it's inconvenient and clumsy.  I'd really rather see a genuine solution.
Sep 10, 2008 at 9:15 PM
Hah.  Maybe I'm a higher genius than I gave myself credit for.

In /editors/tiny_mce/tiny_mce.js (a HUGE javascript file with no line breaks - it'll take a while to open in VS!) look for a section of text that begins with

this._def("valid_elements"

The first entry in this long list of valid element defnitions for HTML tags using the editor looks like this:

+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],

If I add the string |search|category|asin to the end of this segment, so it looks like

+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup|search|category|asin]

Then it should work.  Unfortunately, this one-line javascript file is bogging my machine down beyond belief - I should have just edited it in Notepad and saved myself the trouble - but as soon as it unlocks and I can make the change, I'll test it and follow up.
Sep 10, 2008 at 9:57 PM
No love.  Adding the tags to the "valid_elements" section didn't work, nor did adding them to the "extended_valid_elements" section that follows it  Caches cleared, server re-re-restarted...no lock at all.

Clues, anyone?
Sep 11, 2008 at 10:22 AM
I have found the right way to fix this, done so, and uploaded the file I modified to http://www.codeplex.com/blogengine/WorkItem/View.aspx?WorkItemId=7569 if anyone else needs this functionality.  My apologies in advance if I've breached any etiquette; this is the first time I've contributed to an open-source community.