Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ampersands don't render in annotations of .emf files if " " is used in other text elements #371

Open
michaelbabyn opened this issue May 17, 2021 · 1 comment
Assignees

Comments

@michaelbabyn
Copy link

michaelbabyn commented May 17, 2021

If I input a json that uses   in title text using the below command, the & doesn't appear in annotations in .emf files (all other image types seem to work)

docker run -it -d -p 9091:9091 quay.io/plotly/image-exporter:4.1.0b642
curl -d @minimal-no-ampersand.json -H "accept: image/emf" localhost:9091 -o minimal-no-ampersand.emf

where minimal-no-ampersand.json looks like this

{
	"layout": {
		"yaxis": {
			"title": {
				"font": {
					"size": 11
				},
				"text": "%{meta[1]} "
			}
		},
		"meta": [
			"Stacked Bar Chart Title",
			"A&W Hamburgers",
			"Y-axis label",
			"X-axis label",
			"A&W Hamburgers"
		],
		"annotations": [
			{
				"text": "%{meta[4]} ",
				"align": "left",
				"xanchor": "left",
				"xref": "paper",
				"yref": "paper"
			}
		]
	}
}

Screenshot from 2021-05-17 12-21-07

but this works (I just removed the   from the yaxis title text):

{
	"layout": {
		"yaxis": {
			"title": {
				"font": {
					"size": 11
				},
				"text": "%{meta[1]}"
			}
		},
		"meta": [
			"Stacked Bar Chart Title",
			"A&W Hamburgers",
			"Y-axis label",
			"X-axis label",
			"A&W Hamburgers"
		],
		"annotations": [
			{
				"text": "%{meta[4]} ",
				"align": "left",
				"xanchor": "left",
				"xref": "paper",
				"yref": "paper"
			}
		]
	}
}

cc @plotly/techops

@nicolaskruchten
Copy link
Contributor

Looks like a bug to me. @wbrgss can you please assign someone to investigate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants