passing markup thought a shortcode attribute

You have quite a bit of markup for that shortcode. Trying to pass all of that as a shortcode is going to be trouble.
I pulled it apart to look at it.

  1. id=”map”
  2. z=”11″
  3. w=”100%”
  4. h=”300″
  5. scrollwheel=”false”
  6. maptype=”ROADMAP”
  7. address=”Southampton, United Kingdom”
  8. marker=”true”
  9. markerimage=”http://anachronistic.local:9102/wp-content/plugins/_TomRush/inc/js/TinyMCE_additions/modal/../img/icons/music_folk_map.png
  10. infowindow=”<div class="marker inside"><img class="marker icon"
    alt=""
    src="http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png"
    /><strong>Southampton</strong><br>Southampton, UK<br><span
    class="marker extras">Some User Note</span></div><a class="marker
    jumplink"
    href="https://maps.google.com/maps/place?q=Southampton&amp;ftid=0x48738957be152909:0xa78c5a6a4cda71f0"
    target="_blank">external map</a>

Here is how I would approach it. Of your features, it should be possible to dynamically generate #1, so it can go. I can’t remember what ‘z‘ does so we’ll skip it. #4 and #5 could be a single value, say ‘size‘, and take the “150x150” format designers are familiar with, but that is minor. If a plugin is building it it probably doesn’t matter much. If people were expected to write this stuff in it would. You can allow percentage sized by checking for a “%”. #9, markerimage, can be hard-coded. You aren’t expecting users to pick that file path, right? Hence I assume it doesn’t change. Just toggle it based on #8, marker. Any other static items should be hard-coded as well. Most of #10 looks to me like it can be hard-coded. I don’t see the need to try to pass all of that markup. In fact, the only changeable part looks like maybe the location part– the references to Southhampton, which can be pulled from #7 and filled in. With that in mind, your shortcode looks like:

[my_gmaps z="11" size="100%x300" scrollwheel="false" maptype="ROADMAP" address="Southampton, United Kingdom" marker="true" ]

Maybe you need a way to have the user edit “Some User Note”. Put that in the shortcode “content”.

[my_gmaps z="11" size="100%x300" scrollwheel="false" maptype="ROADMAP" address="Southampton, United Kingdom" marker="true" ] User notes [/my_gmaps]

The rest can be handled when the shortcode is processed, or so it looks to me. If you do need additional configuration than I have allowed try to pass key elements. This 0x48738957be152909:0xa78c5a6a4cda71f0, instead of this https://maps.google.com/maps/place?q=Southampton&amp;ftid=0x48738957be152909:0xa78c5a6a4cda71f0. You know part of that is going to stay the same– at least this part, https://maps.google.com/— no need to pass that around.

Basically, the idea is to pass only the parts that change and strip out/hard code the rest, like passing parameters to a function. You pass the necessary parts and let the function build/do the rest. You wouldn’t pass everything to a function and have the function essentially just concatenate the parameters, right? It is easier to just concatenate the parameters.

I don’t think the right approach is to try to protect the markup as it goes through the shortcode, but instead rethink how the shortcode works so that it doesn’t have that problem in the first place.

I am curious, if your plugin is building this shortcode, why build the shortcode at all? Why not have to plugin just build the working map markup instead?