Last modified: 2007-07-13 17:33:48 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T3962, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 1962 - Allow HTML attributes for <math>
Allow HTML attributes for <math>
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Math (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on: 684
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-23 23:30 UTC by ABCD
Modified: 2007-07-13 17:33 UTC (History)
0 users

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to add title and alt attributes (2.72 KB, patch)
2005-07-13 17:23 UTC, ABCD
Details
Updated - fix error in prev (2.73 KB, patch)
2005-07-14 01:49 UTC, ABCD
Details
Update - fix typo (2.72 KB, patch)
2005-08-01 17:25 UTC, ABCD
Details
Newest fix (3.72 KB, patch)
2005-08-28 22:15 UTC, ABCD
Details
fix it (again!) (1.48 KB, patch)
2005-09-23 22:11 UTC, ABCD
Details
fix it (again!!) - wrong type patch (2.42 KB, patch)
2005-09-23 22:12 UTC, ABCD
Details
fix it (again!!!) - forgot a file (3.65 KB, patch)
2005-09-23 22:15 UTC, ABCD
Details

Description ABCD 2005-04-23 23:30:05 UTC
In a <math> tag, it should be possible to assign the alt and title attributes of
the generated image to something other than the default.  If only the alt
attribute is specified, then the title attribute should be set to the value of
the alt attribute.

Example:
<math alt="1/2">\frac{1}{2}</math>
Comment 1 ABCD 2005-07-13 17:23:59 UTC
Created attachment 704 [details]
Patch to add title and alt attributes

Added untested patch against HEAD
Comment 2 ABCD 2005-07-14 01:49:33 UTC
Created attachment 709 [details]
Updated - fix error in prev

Fixed the patch
Comment 3 Brion Vibber 2005-07-22 21:27:53 UTC
Hmm, I think this won't strip newlines from specified alt or title text. That might be a problem with 
doBlockLevels unless that's been fixed. (eg if there's a newline followed by a list character)
Comment 4 ABCD 2005-08-01 17:25:47 UTC
Created attachment 757 [details]
Update - fix typo
Comment 5 ABCD 2005-08-28 19:55:14 UTC
(In reply to comment #3)
> Hmm, I think this won't strip newlines from specified alt or title text. That
might be a problem with 
> doBlockLevels unless that's been fixed. (eg if there's a newline followed by a
list character)

Testing with this simple test case shows that it works just fine:

<math alt="text" title="some
*text
#&lt;&amp;&gt;

">y=x+2</math>

The text outputed is:

<img class='tex' src="/w/images/math/<SOME_HEX_NUMBER>.png" alt="text"
title="some *text #&lt;&amp;&gt;" />
Comment 6 Brion Vibber 2005-08-28 21:34:12 UTC
Patch as posted (attachment 757 [details]) doesn't appear to work at all, as it references an 
undefined local variable $params in MathRenderer::_linkToMathImage(). If I change 
that reference to $this->params and paste in ABCD's sample, I receive this output:

<p><img class='tex' src="/head/images/math/daa63ef966cc412541190bc8794731de.png" 
alt="text" title="some
</p>
<ul><li>text
</li></ul>
<ol><li>&lt;&amp;&gt;
</li></ol>
<p>" />
</p>
Comment 7 ABCD 2005-08-28 22:15:25 UTC
Created attachment 837 [details]
Newest fix

Forgot that I fixed the patch again - this one works directly on my private
wiki
Comment 8 ABCD 2005-09-23 22:11:01 UTC
Created attachment 910 [details]
fix it (again!)
Comment 9 ABCD 2005-09-23 22:12:26 UTC
Created attachment 911 [details]
fix it (again!!) - wrong type patch
Comment 10 ABCD 2005-09-23 22:15:24 UTC
Created attachment 912 [details]
fix it (again!!!) - forgot a file

I really need to proofread first
Comment 11 Darkoneko 2006-02-15 16:18:43 UTC
So, it's been a few months already, was the patch added or recorrected ?
Comment 12 Aryeh Gregor (not reading bugmail, please e-mail directly) 2006-09-19 02:23:13 UTC
Why not other HTML attributes?  class, style, id, and longdesc would all be
potentially handy.  (IMO, *all* HTML-style tags should have these, where
appropriate: why not?)  Naturally, class/style would be applied to the enclosing
<span>, not to the <img>.

(In reply to comment #11)
> So, it's been a few months already, was the patch added or recorrected ?

Evidently not.
Comment 13 Cristoph Päper 2007-04-13 11:30:45 UTC
Besides images, tables generated from tex input would benefit from classes.
Perhaps all <code>img</code> and <code>table</code> elements should have a class
of „math“ anyway.
Comment 14 Brion Vibber 2007-07-13 17:33:48 UTC
Done in r24065.

Note that 'title' may or may not be technically valid on <math> embedded in HTML, it's kind of unclear, but Mozilla likes it.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links