matplotlib/matplotlib — pull request #2849 by mdboom (2014-02-28 14:13:21+00:00)
Title: WebAgg issue - Uncaught SyntaxError: Unexpected token & 

The following code (from http://matplotlib.org/users/pyplot_tutorial.html):

```
import matplotlib
matplotlib.use('webagg')

import matplotlib.pyplot as plt

plt.plot([1,2,3,4])
plt.ylabel('some numbers')
plt.show()
```

launches the Web server and browser pointing to http://127.0.0.1:8988/ OK, however there's an error in the Chrome's Console:

```
Uncaught SyntaxError: Unexpected token &
```

The offending line is:

```
fig = new figure('1', websocket_url_prefix);
```

in the main HTML document, which seems to be from this template:

```
site-packages/matplotlib/backends/web_backend/all_figures.html
```

which reads:

```
fig = new figure({{ repr(str(fig_id)) }}, websocket_url_prefix);
```

Removing the `repr` call above solves the issue - is there a reason behind it?

More info:

- Matplotlib
```
$ pip show matplotlib
---
Name: matplotlib
Version: 1.3.1
```
- Python 2.7.5+
- Chromium
```
Version 32.0.1700.107 Ubuntu 13.10 (32.0.1700.107-0ubuntu0.13.10.1~20140204.972.1)
```