Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmHTMLEditorKit.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmHTMLEditorKit.java	(revision 8932)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmHTMLEditorKit.java	(revision 8933)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.gui.widgets;
 
+import javax.swing.text.ViewFactory;
 import javax.swing.text.html.HTMLEditorKit;
 import javax.swing.text.html.StyleSheet;
@@ -8,9 +9,13 @@
  * A subclass of {@link HTMLEditorKit} that fixes an uncommon design choice that shares the set stylesheet between all instances.
  * This class stores a single stylesheet per instance, as it should have be done by Sun in the first place.
+ * Moreover it allows to display SVG images.
  * @since 6040
  */
 public class JosmHTMLEditorKit extends HTMLEditorKit {
 
-    protected StyleSheet ss = super.getStyleSheet();
+    /** Shared factory for creating HTML Views. */
+    private static final ViewFactory FACTORY = new JosmHTMLFactory();
+
+    private StyleSheet ss = super.getStyleSheet();
 
     /**
@@ -42,3 +47,8 @@
         return ss;
     }
+
+    @Override
+    public ViewFactory getViewFactory() {
+        return FACTORY;
+    }
 }
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmHTMLFactory.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmHTMLFactory.java	(revision 8933)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmHTMLFactory.java	(revision 8933)
@@ -0,0 +1,37 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.widgets;
+
+import javax.swing.text.AbstractDocument;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.Element;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.View;
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.HTMLEditorKit.HTMLFactory;
+
+import org.openstreetmap.josm.Main;
+
+/**
+ * Specialized HTML Factory allowing to display SVG images.
+ * @since 8933
+ */
+public class JosmHTMLFactory extends HTMLFactory {
+
+    @Override
+    public View create(Element elem) {
+        AttributeSet attrs = elem.getAttributes();
+        Object elementName = attrs.getAttribute(AbstractDocument.ElementNameAttribute);
+        Object o = (elementName != null) ? null : attrs.getAttribute(StyleConstants.NameAttribute);
+        if (o instanceof HTML.Tag) {
+            HTML.Tag kind = (HTML.Tag) o;
+            if (kind == HTML.Tag.IMG) {
+                try {
+                    return new JosmImageView(elem);
+                } catch (NoSuchFieldException | SecurityException e) {
+                    Main.error(e);
+                }
+            }
+        }
+        return super.create(elem);
+    }
+}
Index: trunk/src/org/openstreetmap/josm/gui/widgets/JosmImageView.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/widgets/JosmImageView.java	(revision 8933)
+++ trunk/src/org/openstreetmap/josm/gui/widgets/JosmImageView.java	(revision 8933)
@@ -0,0 +1,169 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.gui.widgets;
+
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Shape;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.URL;
+
+import javax.swing.text.AttributeSet;
+import javax.swing.text.Element;
+import javax.swing.text.html.ImageView;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.tools.ImageProvider;
+
+/**
+ * Specialized Image View allowing to display SVG images.
+ * @since 8933
+ */
+public class JosmImageView extends ImageView {
+
+    private static final int LOADING_FLAG = 1;
+    private static final int WIDTH_FLAG = 4;
+    private static final int HEIGHT_FLAG = 8;
+    private static final int RELOAD_FLAG = 16;
+    private static final int RELOAD_IMAGE_FLAG = 32;
+
+    private final Field imageField;
+    private final Field stateField;
+    private final Field widthField;
+    private final Field heightField;
+
+    /**
+     * Constructs a new {@code JosmImageView}.
+     * @param elem the element to create a view for
+     * @throws SecurityException see {@link Class#getDeclaredField} for details
+     * @throws NoSuchFieldException see {@link Class#getDeclaredField} for details
+     */
+    public JosmImageView(Element elem) throws NoSuchFieldException, SecurityException {
+        super(elem);
+        imageField = ImageView.class.getDeclaredField("image");
+        stateField = ImageView.class.getDeclaredField("state");
+        widthField = ImageView.class.getDeclaredField("width");
+        heightField = ImageView.class.getDeclaredField("height");
+        imageField.setAccessible(true);
+        stateField.setAccessible(true);
+        widthField.setAccessible(true);
+        heightField.setAccessible(true);
+    }
+
+    /**
+     * Makes sure the necessary properties and image is loaded.
+     */
+    private void sync() {
+        try {
+            int s = (int) stateField.get(this);
+            if ((s & RELOAD_IMAGE_FLAG) != 0) {
+                refreshImage();
+            }
+            s = (int) stateField.get(this);
+            if ((s & RELOAD_FLAG) != 0) {
+                synchronized (this) {
+                    stateField.set(this, ((int) stateField.get(this) | RELOAD_FLAG) ^ RELOAD_FLAG);
+                }
+                setPropertiesFromAttributes();
+            }
+        } catch (IllegalArgumentException | IllegalAccessException |
+                InvocationTargetException | NoSuchMethodException | SecurityException e) {
+           Main.error(e);
+       }
+    }
+
+    /**
+     * Loads the image and updates the size accordingly. This should be
+     * invoked instead of invoking <code>loadImage</code> or
+     * <code>updateImageSize</code> directly.
+     * @throws IllegalAccessException see {@link Field#set} and {@link Method#invoke} for details
+     * @throws IllegalArgumentException see {@link Field#set} and {@link Method#invoke} for details
+     * @throws InvocationTargetException see {@link Method#invoke} for details
+     * @throws NoSuchMethodException see {@link Class#getDeclaredMethod} for details
+     * @throws SecurityException see {@link Class#getDeclaredMethod} for details
+     */
+    private void refreshImage() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException,
+        NoSuchMethodException, SecurityException {
+        synchronized (this) {
+            // clear out width/height/reloadimage flag and set loading flag
+            stateField.set(this, ((int) stateField.get(this) | LOADING_FLAG | RELOAD_IMAGE_FLAG | WIDTH_FLAG |
+                     HEIGHT_FLAG) ^ (WIDTH_FLAG | HEIGHT_FLAG |
+                                     RELOAD_IMAGE_FLAG));
+            imageField.set(this, null);
+            widthField.set(this, 0);
+            heightField.set(this, 0);
+        }
+
+        try {
+            // Load the image
+            loadImage();
+
+            // And update the size params
+            Method updateImageSize = ImageView.class.getDeclaredMethod("updateImageSize");
+            updateImageSize.setAccessible(true);
+            updateImageSize.invoke(this);
+        } finally {
+            synchronized (this) {
+                // Clear out state in case someone threw an exception.
+                stateField.set(this, ((int) stateField.get(this) | LOADING_FLAG) ^ LOADING_FLAG);
+            }
+        }
+    }
+
+    /**
+     * Loads the image from the URL <code>getImageURL</code>. This should
+     * only be invoked from <code>refreshImage</code>.
+     * @throws IllegalAccessException see {@link Field#set} and {@link Method#invoke} for details
+     * @throws IllegalArgumentException see {@link Field#set} and {@link Method#invoke} for details
+     * @throws InvocationTargetException see {@link Method#invoke} for details
+     * @throws NoSuchMethodException see {@link Class#getDeclaredMethod} for details
+     * @throws SecurityException see {@link Class#getDeclaredMethod} for details
+     */
+    private void loadImage() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException,
+        NoSuchMethodException, SecurityException {
+        URL src = getImageURL();
+        if (src != null) {
+            String urlStr = src.toExternalForm();
+            if (urlStr.endsWith(".svg") || urlStr.endsWith(".svg?format=raw")) {
+                imageField.set(this, new ImageProvider(urlStr).get().getImage());
+            } else {
+                Method loadImage = ImageView.class.getDeclaredMethod("loadImage");
+                loadImage.setAccessible(true);
+                loadImage.invoke(this);
+            }
+        } else {
+            imageField.set(this, null);
+        }
+    }
+
+    @Override
+    public Image getImage() {
+        sync();
+        return super.getImage();
+    }
+
+    @Override
+    public AttributeSet getAttributes() {
+        sync();
+        return super.getAttributes();
+    }
+
+    @Override
+    public void paint(Graphics g, Shape a) {
+        sync();
+        super.paint(g, a);
+    }
+
+    @Override
+    public float getPreferredSpan(int axis) {
+        sync();
+        return super.getPreferredSpan(axis);
+    }
+
+    @Override
+    public void setSize(float width, float height) {
+        sync();
+        super.setSize(width, height);
+    }
+}
Index: trunk/src/org/openstreetmap/josm/tools/Utils.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 8932)
+++ trunk/src/org/openstreetmap/josm/tools/Utils.java	(revision 8933)
@@ -1411,5 +1411,5 @@
      */
     public static boolean hasExtension(String filename, String... extensions) {
-        String name = filename.toLowerCase(Locale.ENGLISH);
+        String name = filename.toLowerCase(Locale.ENGLISH).replace("?format=raw", "");
         for (String ext : extensions) {
             if (name.endsWith('.' + ext.toLowerCase(Locale.ENGLISH)))
Index: trunk/src/org/openstreetmap/josm/tools/WikiReader.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/WikiReader.java	(revision 8932)
+++ trunk/src/org/openstreetmap/josm/tools/WikiReader.java	(revision 8933)
@@ -142,5 +142,7 @@
                 // add a border="0" attribute to images, otherwise the internal help browser
                 // will render a thick  border around images inside an <a> element
+                // remove width information to avoid distorded images (fix #11262)
                 b.append(line.replaceAll("<img ", "<img border=\"0\" ")
+                         .replaceAll("width=\"(\\d+)\"", "")
                          .replaceAll("<span class=\"icon\">.</span>", "")
                          .replaceAll("href=\"/", "href=\"" + baseurl + '/')
