<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,6 @@
+== 1.3.X
+* added code to properly escape image tag URLs (mokolabs)
+
 == 1.3.4
 * updated documentation and cleaned it up (mokolabs)
 * added support for custom class, id and alt tags when using the image_tag format (i.e Gchart.line(:data =&gt; [0, 26], :format =&gt; 'image_tag')) (mokolabs)</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -130,7 +130,7 @@ class Gchart
     image = &quot;&lt;img&quot;
     image += &quot; id=\&quot;#{@id}\&quot;&quot; if @id  
     image += &quot; class=\&quot;#{@class}\&quot;&quot; if @class      
-    image += &quot; src=\&quot;#{query_builder}\&quot;&quot;
+    image += &quot; src=\&quot;#{query_builder(:html)}\&quot;&quot;
     image += &quot; width=\&quot;#{@width}\&quot;&quot;
     image += &quot; height=\&quot;#{@height}\&quot;&quot;
     image += &quot; alt=\&quot;#{@alt}\&quot;&quot;
@@ -368,7 +368,7 @@ class Gchart
   end
   
   
-  def query_builder
+  def query_builder(options=&quot;&quot;)
     query_params = instance_variables.map do |var|
       case var
       # Set the graph size  
@@ -399,7 +399,15 @@ class Gchart
       end
     end.compact
     
-    jstize(@@url + query_params.join('&amp;'))
+    # Use ampersand as default delimiter
+    unless options == :html
+      delimiter = '&amp;'
+    # Escape ampersand for html image tags
+    else
+      delimiter = '&amp;amp;'
+    end
+    
+    jstize(@@url + query_params.join(delimiter))
   end
   
 end
\ No newline at end of file</diff>
      <filename>lib/gchart.rb</filename>
    </modified>
    <modified>
      <diff>@@ -404,6 +404,15 @@ describe 'exporting a chart' do
   it &quot;should be available as an image tag using custom css class selector&quot; do
     Gchart.line(:data =&gt; [0, 26], :format =&gt; 'image_tag', :class =&gt; 'chart').should match(/&lt;img class=&quot;chart&quot; src=(.*) width=&quot;300&quot; height=&quot;200&quot; alt=&quot;Google Chart&quot; \/&gt;/)
   end
+
+  it &quot;should use ampersands to separate key/value pairs in URLs by default&quot; do
+    Gchart.line(:data =&gt; [0, 26]).should satisfy {|chart| chart.include? &quot;&amp;&quot; }
+    Gchart.line(:data =&gt; [0, 26]).should_not satisfy {|chart| chart.include? &quot;&amp;amp;&quot; }
+  end
+  
+  it &quot;should escape ampersands in URLs when used as an image tag&quot; do
+    Gchart.line(:data =&gt; [0, 26], :format =&gt; 'image_tag', :class =&gt; 'chart').should satisfy {|chart| chart.include? &quot;&amp;amp;&quot; }
+  end
    
   it &quot;should be available as a file&quot; do
     File.delete('chart.png') if File.exist?('chart.png')</diff>
      <filename>spec/gchart_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -562,7 +562,7 @@ Data set:
 	&lt;p&gt;&lt;strong&gt;Insert as an image tag&lt;/strong&gt;&lt;/p&gt;
 
 
-	&lt;p&gt;Because, I&amp;#8217;m lazy, you can generate a full image tag, with support for the standard html options.&lt;/p&gt;
+	&lt;p&gt;Because, I&amp;#8217;m lazy, you can generate a full image tag, with support for standard html options.&lt;/p&gt;
 
 
 	&lt;p&gt;&lt;pre class='syntax'&gt;
@@ -571,7 +571,7 @@ Data set:
 
 
 	&lt;p&gt;&lt;pre class='syntax'&gt;
-&lt;span class=&quot;punct&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;http://chart.apis.google.com/chart?chs=300x200&amp;amp;chd=s:A9&amp;amp;cht=lc&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;Google Chart&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;/&amp;gt;&lt;/span&gt;
+&lt;span class=&quot;punct&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;ident&quot;&gt;img&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;http://chart.apis.google.com/chart?chs=300x200&amp;amp;amp;chd=s:A9&amp;amp;amp;cht=lc&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;width&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;300&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;height&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;ident&quot;&gt;alt&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;=&amp;quot;&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;Google Chart&lt;/span&gt;&lt;span class=&quot;punct&quot;&gt;&amp;quot;&lt;/span&gt; &lt;span class=&quot;punct&quot;&gt;/&amp;gt;&lt;/span&gt;
 &lt;/pre&gt;&lt;/p&gt;
 
 
@@ -716,7 +716,7 @@ Data set:
 &lt;a href=&quot;http://github.com/takeo&quot;&gt;Toby Sterrett&lt;/a&gt;
 &lt;a href=&quot;http://github.com/mokolabs&quot;&gt;Patrick Crowley&lt;/a&gt;&lt;/p&gt;
     &lt;p class=&quot;coda&quot;&gt;
-      &lt;a href=&quot;mattaimonetti@gmail.com&quot;&gt;Matt Aimonetti&lt;/a&gt;, 26th June 2008&lt;br&gt;
+      &lt;a href=&quot;mattaimonetti@gmail.com&quot;&gt;Matt Aimonetti&lt;/a&gt;, 2nd July 2008&lt;br&gt;
       Theme extended from &lt;a href=&quot;http://rb2js.rubyforge.org/&quot;&gt;Paul Battley&lt;/a&gt;
     &lt;/p&gt;
 &lt;/div&gt;</diff>
      <filename>website/index.html</filename>
    </modified>
    <modified>
      <diff>@@ -397,14 +397,14 @@ Gchart.line(:data =&gt; [0, 26], :format =&gt; 'file', :filename =&gt; 'custom_filename.p
 
 *Insert as an image tag*
 
-Because, I'm lazy, you can generate a full image tag, with support for the standard html options.
+Because, I'm lazy, you can generate a full image tag, with support for standard html options.
 
 &lt;pre syntax=&quot;ruby&quot;&gt;
 Gchart.line(:data =&gt; [0, 26], :format =&gt; 'image_tag')
 &lt;/pre&gt;
 
 &lt;pre syntax=&quot;ruby&quot;&gt;
-&lt;img src=&quot;http://chart.apis.google.com/chart?chs=300x200&amp;chd=s:A9&amp;cht=lc&quot; width=&quot;300&quot; height=&quot;200&quot; alt=&quot;Google Chart&quot; /&gt;
+&lt;img src=&quot;http://chart.apis.google.com/chart?chs=300x200&amp;amp;chd=s:A9&amp;amp;cht=lc&quot; width=&quot;300&quot; height=&quot;200&quot; alt=&quot;Google Chart&quot; /&gt;
 &lt;/pre&gt;
 
 Here are a few more examples:</diff>
      <filename>website/index.txt</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a02bbf85e38751c4715c1f1ab7e161243ac8fb1a</id>
    </parent>
  </parents>
  <author>
    <name>Patrick</name>
    <email>patrick@mokolabs.com</email>
  </author>
  <url>http://github.com/mattetti/googlecharts/commit/c05957222941cbbfebe17076d730de84c61e17b6</url>
  <id>c05957222941cbbfebe17076d730de84c61e17b6</id>
  <committed-date>2008-07-02T01:44:39-07:00</committed-date>
  <authored-date>2008-07-02T01:44:39-07:00</authored-date>
  <message>added code to properly escape image tag URLs</message>
  <tree>632345e8bb58878f72ffb671be4fc707c4c2b22b</tree>
  <committer>
    <name>Patrick</name>
    <email>patrick@mokolabs.com</email>
  </committer>
</commit>
