Skip to content
This repository

use null char to start markdown cell placeholder #729

Merged
merged 1 commit into from over 2 years ago

3 participants

Min RK Fernando Perez Brian E. Granger
Min RK
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.

Fernando Perez
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..

Min RK
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.

Brian E. Granger ellisonbg merged commit 5ae42c2 into from August 25, 2011
Brian E. Granger ellisonbg closed this August 25, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Aug 25, 2011
Min RK use null char to start text cell placeholders 5ae42c2
This page is out of date. Refresh to see the latest.
8  IPython/frontend/html/notebook/static/js/textcell.js
@@ -15,7 +15,7 @@ var IPython = (function (IPython) {
15 15
 
16 16
     var TextCell = function (notebook) {
17 17
         this.code_mirror_mode = this.code_mirror_mode || 'htmlmixed';
18  
-        this.placeholder = this.placeholder || '𝄆';
  18
+        this.placeholder = this.placeholder || '\u0000';
19 19
         IPython.Cell.apply(this, arguments);
20 20
         this.rendered = false;
21 21
         this.cell_type = this.cell_type || 'text';
@@ -159,7 +159,7 @@ var IPython = (function (IPython) {
159 159
     // HTMLCell
160 160
 
161 161
     var HTMLCell = function (notebook) {
162  
-        this.placeholder = "&#x1D106; Type <strong>HTML</strong> and LaTeX: $\\alpha^2$";
  162
+        this.placeholder = "\u0000Type <strong>HTML</strong> and LaTeX: $\\alpha^2$";
163 163
         IPython.TextCell.apply(this, arguments);
164 164
         this.cell_type = 'html';
165 165
     };
@@ -184,7 +184,7 @@ var IPython = (function (IPython) {
184 184
     // MarkdownCell
185 185
 
186 186
     var MarkdownCell = function (notebook) {
187  
-        this.placeholder = "&#x1D106; Type *Markdown* and LaTeX: $\\alpha^2$";
  187
+        this.placeholder = "\u0000Type *Markdown* and LaTeX: $\\alpha^2$";
188 188
         IPython.TextCell.apply(this, arguments);
189 189
         this.cell_type = 'markdown';
190 190
     };
@@ -222,7 +222,7 @@ var IPython = (function (IPython) {
222 222
     // RSTCell
223 223
 
224 224
     var RSTCell = function (notebook) {
225  
-        this.placeholder = "&#x1D106; Type *ReStructured Text* and LaTeX: $\\alpha^2$";
  225
+        this.placeholder = "\u0000Type *ReStructured Text* and LaTeX: $\\alpha^2$";
226 226
         IPython.TextCell.apply(this, arguments);
227 227
         this.cell_type = 'rst';
228 228
     };
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.