I have another local modification to Quickbook. Currently a qbk image
such as [$images/smiley.png] will (eventually) generate HTML

<img src="images/smiley.png">

which is not strictly valid since no alt attribute is present.
I suggest using the basename of the image file as alt text.

<img src="images/smiley.png" alt="smiley">

Here is a patch to details/actions.cpp

--- actions.cpp 9 Dec 2005 13:25:59 -0000       1.28
+++ actions.cpp 15 Dec 2005 17:07:41 -0000
@@ -10,6 +10,7 @@
 #include <numeric>
 #include <functional>
 #include <boost/bind.hpp>
+#include <boost/filesystem/convenience.hpp>
 #include "./actions.hpp"

 #if (defined(BOOST_MSVC) && (BOOST_MSVC <= 1310))
@@ -331,10 +332,22 @@

     void image_action::operator()(iterator first, iterator const& last) const
     {
-        phrase << "<inlinemediaobject><imageobject><imagedata fileref=\"";
+        fs::path const img_path(std::string(first, last));
+
+        phrase << "<inlinemediaobject>";
+
+        phrase << "<imageobject><imagedata fileref=\"";
         while (first != last)
             detail::print_char(*first++, phrase);
-        phrase << "\"></imagedata></imageobject></inlinemediaobject>";
+        phrase << "\"></imagedata></imageobject>";
+
+        // Also add a textobject -- use the basename of the image file.
+        // This will mean we get "alt" attributes of the HTML img.
+        phrase << "<textobject><phrase>";
+        detail::print_string(fs::basename(img_path), phrase);
+        phrase << "</phrase></textobject>";
+
+        phrase << "</inlinemediaobject>";
     }

     void indentifier_action::operator()(iterator const& first,
iterator const& last) const

--
Thomas Guest
http://www.wordaligned.org


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Boost-docs mailing list
[email protected]
Unsubscribe and other administrative requests: 
https://lists.sourceforge.net/lists/listinfo/boost-docs

Reply via email to