Difference between revisions of "Extension talk:LinkifySVG"
From Organic Design wiki
(easy to linkify SVG's) |
|||
| Line 1: | Line 1: | ||
| + | == Purpose == | ||
This extension is planned to intercept uploading of SVG files and convert any text in them into links if they contain a valid URL or are surrounded by double square brackets to indicate a wiki article. | This extension is planned to intercept uploading of SVG files and convert any text in them into links if they contain a valid URL or are surrounded by double square brackets to indicate a wiki article. | ||
| + | == Linkifying an SVG == | ||
First the ''xlink'' namespace must be added to the SVG opening element: | First the ''xlink'' namespace must be added to the SVG opening element: | ||
{{code|<pre>xmlns:xlink="http://www.w3.org/1999/xlink"</pre>}} | {{code|<pre>xmlns:xlink="http://www.w3.org/1999/xlink"</pre>}} | ||
| Line 14: | Line 16: | ||
</a> | </a> | ||
</xml>}} | </xml>}} | ||
| + | |||
| + | == Intercepting uploaded SVG's == | ||
| + | This could be done by checking the posted data for uploads. | ||
Revision as of 05:20, 27 February 2009
Purpose
This extension is planned to intercept uploading of SVG files and convert any text in them into links if they contain a valid URL or are surrounded by double square brackets to indicate a wiki article.
Linkifying an SVG
First the xlink namespace must be added to the SVG opening element:
Next the XML must be parsed and any text elements with matching content converted by surrounding it with an a element. Here's an example of a text element from an SVG created with Inkscape which has been simplified a bit for clarity and linkified.
Intercepting uploaded SVG's
This could be done by checking the posted data for uploads.



