www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 62236bb26fcf2d75abb8bf09024fc9afcef923b8
parent 5c8919bc3cf0084465920bacaa8211ab2f76cf29
Author: Davide P. Cervone <dpvc@union.edu>
Date:   Mon, 29 Apr 2013 16:04:18 -0400

Merge branch 'issue364' into develop

Resolves issue #364.

Diffstat:
Munpacked/jax/output/HTML-CSS/jax.js | 23++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/unpacked/jax/output/HTML-CSS/jax.js b/unpacked/jax/output/HTML-CSS/jax.js @@ -760,15 +760,15 @@ parent.bbox = this.Measured(span,parent).bbox; }, MeasureSpans: function (SPANS) { - var spans = [], span, i, m, bbox, start, end, W; + var spans = [], span, i, m, bbox, start, end, W, parent; // // Insert the needed markers // for (i = 0, m = SPANS.length; i < m; i++) { span = SPANS[i]; if (!span) continue; - bbox = span.bbox; + bbox = span.bbox; parent = this.parentNode(span); if (bbox.exactW || bbox.width || bbox.w === 0 || bbox.isMultiline) { - if (!span.parentNode.bbox) {span.parentNode.bbox = bbox} + if (!parent.bbox) {parent.bbox = bbox} continue; } if (this.negativeBBoxes || !span.firstChild || (bbox.w >= 0 && !this.initialSkipBug) || @@ -787,11 +787,11 @@ // Read the widths and heights // for (i = 0, m = spans.length; i < m; i++) { - span = spans[i][0]; bbox = span.bbox; var parent = span.parentNode; + span = spans[i][0]; bbox = span.bbox; parent = this.parentNode(span); if ((bbox.w >= 0 && !this.initialSkipBug) || this.negativeBBoxes || !span.firstChild) { - W = span.offsetWidth; parent.HH = span.parentNode.offsetHeight/this.em; + W = span.offsetWidth; parent.HH = parent.offsetHeight/this.em; } else if (bbox.w < 0 && this.msieNegativeBBoxBug) { - W = -span.offsetWidth, parent.HH = span.parentNode.offsetHeight/this.em; + W = -span.offsetWidth, parent.HH = parent.offsetHeight/this.em; } else { W = spans[i][2].offsetLeft - ((spans[i][1]||{}).offsetLeft||0); } @@ -976,6 +976,15 @@ if (D) {frame.style.verticalAlign = D} return frame; }, + + // + // Find parent span (skipping over <a> tags) + // + parentNode: function (span) { + var parent = span.parentNode; + if (parent.nodeName.toLowerCase() === "a") {parent = parent.parentNode} + return parent; + }, createStack: function (span,nobbox,w) { if (this.msiePaddingWidthBug) {this.createStrut(span,0)} @@ -1007,7 +1016,7 @@ }, placeBox: function (span,x,y,noclip) { span.isMathJax = true; - var parent = span.parentNode, bbox = span.bbox, BBOX = parent.bbox; + var parent = HTMLCSS.parentNode(span), bbox = span.bbox, BBOX = parent.bbox; if (this.msiePlaceBoxBug) {this.addText(span,this.NBSP)} if (this.imgSpaceBug) {this.addText(span,this.imgSpace)} // Place the box