links = re.compile(r"<a href=\"(.*?)\">(.*?)</a>")
# Images
- images = re.compile(r"<img src=\"(.*?)\" alt=\"(.*?)\" (?:title=\"(.*?)\" )?/>")
+ images = re.compile(r"<img alt(?:=\"(.*?)\")? src=\"(.*?)\" (?:title=\"(.*?)\" )?/>")
def init(self, path):
self.path = path
(path, text or self.backend.wiki.get_page_title(path))
def _render_image(self, m):
- url, alt_text, caption = m.groups()
+ alt_text, url, caption = m.groups()
# Skip any absolute and external URLs
if url.startswith("/") or url.startswith("https://") or url.startswith("http://"):