Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

use null char to start markdown cell placeholder #729

Merged
merged 1 commit into from

3 participants

@minrk
Owner

'&#x1D106' was added to the front of the placeholder text, to allow 'T' to be typed, but that simply prevented '&' from being typed. A null character should actually be safe until the codemirror bug is worked out.

@fperez
Owner

search for that 1d106 string in the whole code, I'm pretty sure it was in more than one place in the previous PR. If it works, that's fine... Alternatively, if \u can serve as an escape instead of &, it could just be a matter of replacing the escapes.

Though the null has the advantage of being non-printing, which is nice (the musical one shows up). As long as it doesn't introduce other weirdnes..

@minrk
Owner

The '&' is the HTML escape for unicode, but in javascript it's just the ascii string exactly as it appears, so it isn't treated any differently by codemirror than 'T' or '.' was before.

I haven't found any issues, even copying and pasting null-char-including strings into the cell (I think they were stripped out from the clipboard, though).

I just pushed again, after searching for the 1D106, and replacing everything I found.

@ellisonbg ellisonbg merged commit 5ae42c2 into ipython:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 25, 2011
  1. @minrk
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 4 deletions.
  1. +4 −4 IPython/frontend/html/notebook/static/js/textcell.js
View
8 IPython/frontend/html/notebook/static/js/textcell.js
@@ -15,7 +15,7 @@ var IPython = (function (IPython) {
var TextCell = function (notebook) {
this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed';
- this.placeholder = this.placeholder || '𝄆';
+ this.placeholder = this.placeholder || '\u0000';
IPython.Cell.apply(this, arguments);
this.rendered = false;
this.cell_type = this.cell_type || 'text';
@@ -159,7 +159,7 @@ var IPython = (function (IPython) {
// HTMLCell
var HTMLCell = function (notebook) {
- this.placeholder = "&#x1D106; Type <strong>HTML</strong> and LaTeX: $\\alpha^2$";
+ this.placeholder = "\u0000Type <strong>HTML</strong> and LaTeX: $\\alpha^2$";
IPython.TextCell.apply(this, arguments);
this.cell_type = 'html';
};
@@ -184,7 +184,7 @@ var IPython = (function (IPython) {
// MarkdownCell
var MarkdownCell = function (notebook) {
- this.placeholder = "&#x1D106; Type *Markdown* and LaTeX: $\\alpha^2$";
+ this.placeholder = "\u0000Type *Markdown* and LaTeX: $\\alpha^2$";
IPython.TextCell.apply(this, arguments);
this.cell_type = 'markdown';
};
@@ -222,7 +222,7 @@ var IPython = (function (IPython) {
// RSTCell
var RSTCell = function (notebook) {
- this.placeholder = "&#x1D106; Type *ReStructured Text* and LaTeX: $\\alpha^2$";
+ this.placeholder = "\u0000Type *ReStructured Text* and LaTeX: $\\alpha^2$";
IPython.TextCell.apply(this, arguments);
this.cell_type = 'rst';
};
Something went wrong with that request. Please try again.