[dia] Use <a xlink:href> together with the meta url attribute in SVG export.



commit 8bd941996708190c9cda2b8858942ad12167a57c
Author: Steffen Macke <sdteffen sdteffen de>
Date:   Wed Sep 28 21:07:23 2011 +0200

    Use <a xlink:href> together with the meta url attribute in SVG export.

 plug-ins/python/diasvg.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plug-ins/python/diasvg.py b/plug-ins/python/diasvg.py
index 0701fde..c4f90eb 100644
--- a/plug-ins/python/diasvg.py
+++ b/plug-ins/python/diasvg.py
@@ -48,8 +48,12 @@ class SvgRenderer :
 		self.f.close()
 	def draw_object (self, object, matrix) :
 		self.f.write("<!-- " + object.type.name + " -->\n")
+		if object.properties.has_key('meta') and object.properties['meta'].value.has_key('url'):
+			self.f.write('<a xlink:href="%s">' % (object.properties['meta'].value['url']))
 		# don't forget to render the object
 		object.draw (self)
+		if object.properties.has_key('meta') and object.properties['meta'].value.has_key('url'):
+			self.f.write('</a>')
 	def set_linewidth (self, width) :
 		if width < 0.001 : # zero line width is invisble ?
 			self.line_width = 0.001



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]