(.*)<\/div>$/, '$1');
this._noteText = note ? note : '';
diff --git a/chrome/content/zotero/xpcom/data/notes.js b/chrome/content/zotero/xpcom/data/notes.js
index a22813267..c99747589 100644
--- a/chrome/content/zotero/xpcom/data/notes.js
+++ b/chrome/content/zotero/xpcom/data/notes.js
@@ -30,6 +30,9 @@ Zotero.Notes = new function() {
* Return first line (or first MAX_LENGTH characters) of note content
**/
function noteToTitle(text) {
+ text = Zotero.Utilities.prototype.trim(text);
+ text = Zotero.Utilities.prototype.unescapeHTML(text);
+
var max = this.MAX_TITLE_LENGTH;
var t = text.substring(0, max);
diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js
index 6589df9c2..8748e3d95 100644
--- a/chrome/content/zotero/xpcom/db.js
+++ b/chrome/content/zotero/xpcom/db.js
@@ -995,6 +995,20 @@ Zotero.DBConnection.prototype._getDBConnection = function () {
};
this._connection.createFunction('regexp', 2, rx);
+ // text2html UDF
+ var rx = {
+ onFunctionCall: function (arg) {
+ var str = arg.getUTF8String(0);
+ str = Zotero.Utilities.prototype.htmlSpecialChars(str);
+ str = '
'
+ + str.replace(/\n/g, '
')
+ .replace(/\t/g, ' ')
+ .replace(/ /g, ' ')
+ + '
';
+ return str.replace(/
\s*<\/p>/g, '
');
+ }
+ };
+ this._connection.createFunction('text2html', 1, rx);
return this._connection;
}
diff --git a/chrome/content/zotero/xpcom/report.js b/chrome/content/zotero/xpcom/report.js
index f3c3d0888..7886930f7 100644
--- a/chrome/content/zotero/xpcom/report.js
+++ b/chrome/content/zotero/xpcom/report.js
@@ -70,7 +70,14 @@ Zotero.Report = new function() {
// Independent note
if (arr['note']) {
- content += '
' + escapeXML(arr['note']) + '
\n';
+ content += '\n';
+ if (arr.note.substr(0, 1024).match(/
]*>/)) {
+ content += arr.note + '\n';
+ }
+ // Wrap plaintext notes in
+ else {
+ content += '
' + arr.note + '
\n';
+ }
}
}
@@ -85,7 +92,15 @@ Zotero.Report = new function() {
content += '
\n';
for each(var note in arr.reportChildren.notes) {
content += '- \n';
- content += '
' + escapeXML(note.note) + '
\n';
+
+ content += note.note + '\n';
+ if (note.note.substr(0, 1024).match(/]*>/)) {
+ content += note.note + '\n';
+ }
+ // Wrap plaintext notes in
+ else {
+ content += '
' + note.note + '
\n';
+ }
// Child note tags
content += _generateTagsList(note);
diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js
index 6f9b293dc..48f278d5c 100644
--- a/chrome/content/zotero/xpcom/schema.js
+++ b/chrome/content/zotero/xpcom/schema.js
@@ -1945,6 +1945,11 @@ Zotero.Schema = new function(){
if (i==42) {
Zotero.DB.query("UPDATE itemAttachments SET syncState=0");
}
+
+ // 1.5 Sync Preview 2.3
+ if (i==43) {
+ Zotero.DB.query("UPDATE itemNotes SET note='' || TEXT2HTML(note) || '
' WHERE note NOT LIKE ' li p:last-child {
/* Preserve whitespace on notes */
-ul.notes li p, li.note p {
- white-space: pre-wrap; /* css-3 */
- white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
- white-space: -pre-wrap; /* Opera 4-6 */
- white-space: -o-pre-wrap; /* Opera 7 */
- word-wrap: break-word; /* Internet Explorer 5.5+ */
+ul.notes li p.plaintext, li.note p.plaintext {
+ white-space: pre-wrap;
}
/* Display tags within child notes inline */
diff --git a/chrome/skin/default/zotero/tinymce-content.css b/chrome/skin/default/zotero/tinymce/integration-content.css
similarity index 75%
rename from chrome/skin/default/zotero/tinymce-content.css
rename to chrome/skin/default/zotero/tinymce/integration-content.css
index eb1f290b6..28158e5bb 100755
--- a/chrome/skin/default/zotero/tinymce-content.css
+++ b/chrome/skin/default/zotero/tinymce/integration-content.css
@@ -1,2 +1,2 @@
-body, td, pre {font-family:Times New Roman, Times, serif; font-size:14px; margin: 8px;}
+body, td, pre {font-family:Times New Roman, Times, serif; font-size:14px; margin: 8px;}
p, div {margin:0; padding:0}
\ No newline at end of file
diff --git a/chrome/skin/default/zotero/tinymce/note-content.css b/chrome/skin/default/zotero/tinymce/note-content.css
new file mode 100644
index 000000000..8b4b8d87e
--- /dev/null
+++ b/chrome/skin/default/zotero/tinymce/note-content.css
@@ -0,0 +1,14 @@
+body {
+ font-size: 11px;
+ font-family: Lucida Grande, Tahoma, Verdana, Helvetica, sans-serif;
+}
+
+/*
+blockquote p:not(:empty):before {
+ content: '“'
+}
+
+blockquote p:not(:empty):after {
+ content: '”'
+}
+*/
diff --git a/userdata.sql b/userdata.sql
index 5aa23ca52..7afaf79e2 100644
--- a/userdata.sql
+++ b/userdata.sql
@@ -1,4 +1,4 @@
--- 42
+-- 43
-- This file creates tables containing user-specific data -- any changes made
-- here must be mirrored in transition steps in schema.js::_migrateSchema()