Skip to content
This repository was archived by the owner on Aug 27, 2026. It is now read-only.
This repository was archived by the owner on Aug 27, 2026. It is now read-only.

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

Description

@michaelbabyn

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions