diff --git a/latex2edx/plastexit.py b/latex2edx/plastexit.py index 19ea34f..e655699 100644 --- a/latex2edx/plastexit.py +++ b/latex2edx/plastexit.py @@ -120,7 +120,7 @@ def filter_fix_displaymathverbatim(cls, m): x = m.group(1).strip() # plastex2.1 - already escaped return '[mathjax]%s[/mathjax]' % x.replace('\\end{edXmath}', '') - filter_fix_image_match = '(.*?)' + filter_fix_image_match = '(.*?)' def filter_fix_image(self, m): width = 400 @@ -148,6 +148,12 @@ def filter_fix_image(self, m): attribs = ';'.join(attribs) if attribs: attribs = 'style="' + attribs + '"' + alt = m.group(2) + if alt: + # Note for an empty alt text must have one single space + if alt == " ": + alt = "" + attribs = attribs + ' alt="' + alt + '"' def make_image_html(fn,k,attribs): self.imfnset.append(fn+k) @@ -163,7 +169,7 @@ def make_image_html(fn,k,attribs): src = self.imurl_fmt.format(imurl=self.imurl, fnbase=fnbase) return '' % (src, width, attribs) - fnset = [m.group(2)] + fnset = [m.group(3)] fnsuftab = ['','.png','.pdf','.png','.jpg'] for k in fnsuftab: for fn in fnset: diff --git a/latex2edx/plastexpy/edXpsl.py b/latex2edx/plastexpy/edXpsl.py index e481d6d..28a835d 100755 --- a/latex2edx/plastexpy/edXpsl.py +++ b/latex2edx/plastexpy/edXpsl.py @@ -133,7 +133,7 @@ class edXdiscussion(Base.Command): class includegraphics(Base.Command): - args = '[ width ] self' + args = '[ width ] [ alt ] self' class marginote(Base.Command): # tooltip margin note \marginote[options]{note}{anchor text} diff --git a/latex2edx/render/edXpsl.zpts b/latex2edx/render/edXpsl.zpts index 697ac61..364bf4b 100755 --- a/latex2edx/render/edXpsl.zpts +++ b/latex2edx/render/edXpsl.zpts @@ -74,7 +74,7 @@ name: edXdiscussion name: includegraphics - + name: edXcite