Skip to content

Commit

Permalink
Merge pull request #67 from dudeOFprosper/add-src-altTextPlugin
Browse files Browse the repository at this point in the history
Add src value to $error image if it is available - Fixes #65
  • Loading branch information
jdan committed Sep 14, 2015
2 parents 2f6d9d6 + 7c0acfc commit 26e38c5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/alt-text/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class AltTextPlugin extends Plugin {

reportError(el) {
let $el = $(el);
let src = $el.attr("src") || "..";
let title = "Image is missing alt text";
let $error = (
<div>
Expand All @@ -27,7 +28,7 @@ class AltTextPlugin extends Plugin {
</p>

<pre><code>
{`&lt;img src=".." alt="Image description"&gt`}
{`&lt;img src="${src}" alt="Image description"&gt`}
</code></pre>

<p>
Expand All @@ -38,9 +39,9 @@ class AltTextPlugin extends Plugin {
</p>

<pre><code>
{`&lt;img src=".." alt=""&gt;`}
{`&lt;img src="${src}" alt=""&gt;`}
<br />
{`&lt;img src=".." role="presentation"&gt;`}
{`&lt;img src="${src}" role="presentation"&gt;`}
</code></pre>
</div>
);
Expand Down

0 comments on commit 26e38c5

Please sign in to comment.