Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e8e7854

Browse filesBrowse files
committed
Merge pull request plotly#104 from plotly/firefox-toImage
Fix Firefox toImage failures
2 parents edcfe7e + 7e21ea7 commit e8e7854
Copy full SHA for e8e7854

File tree

Expand file treeCollapse file tree

3 files changed

+17
-4
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+17
-4
lines changed

‎src/plots/layout_attributes.js

Copy file name to clipboardExpand all lines: src/plots/layout_attributes.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var extendFlat = Plotly.Lib.extendFlat;
1818
module.exports = {
1919
font: {
2020
family: extendFlat({}, fontAttrs.family, {
21-
dflt: '"Open sans", verdana, arial, sans-serif'
21+
dflt: '"Open Sans", verdana, arial, sans-serif'
2222
}),
2323
size: extendFlat({}, fontAttrs.size, {
2424
dflt: 12

‎src/plots/plots.js

Copy file name to clipboardExpand all lines: src/plots/plots.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,8 +288,8 @@ plots.addLinks = function(gd) {
288288
linkContainer.enter().append('text')
289289
.classed('js-plot-link-container', true)
290290
.style({
291-
'font-family':'"Open Sans",Arial,sans-serif',
292-
'font-size':'12px',
291+
'font-family':'"Open Sans", Arial, sans-serif',
292+
'font-size': '12px',
293293
'fill': Plotly.Color.defaultLine,
294294
'pointer-events': 'all'
295295
})

‎src/snapshot/tosvg.js

Copy file name to clipboardExpand all lines: src/snapshot/tosvg.js
+14-1Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,21 @@ module.exports = function toSVG(gd, format) {
113113
// serialized svg because the style attribute itself is double-quoted!
114114
// Is this an IE thing? Any other attributes or style elements that can have quotes in them?
115115
// TODO: this looks like a noop right now - what happened to it?
116+
117+
/*
118+
* Font-family styles with double quotes in them breaks the to-image
119+
* step in FF42 because the style attribute itself is wrapped in
120+
* double quotes. See:
121+
*
122+
* - http://codepen.io/etpinard/pen/bEdQWK
123+
* - https://github.com/plotly/plotly.js/pull/104
124+
*
125+
* for more info.
126+
*/
116127
var ff = txt.style('font-family');
117-
if(ff && ff.indexOf('"') !== -1) txt.style('font-family', ff.replace(/"/g, '"'));
128+
if(ff && ff.indexOf('"') !== -1) {
129+
txt.style('font-family', ff.replace(/"/g, '\\\''));
130+
}
118131
});
119132

120133
if(format === 'pdf' || format === 'eps') {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.