Skip to content

Commit

Permalink
Fixing xml bug for & in annotation comment
Browse files Browse the repository at this point in the history
  • Loading branch information
frianasoa committed Dec 14, 2023
1 parent d695ff6 commit fc25d30
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions content/notes/menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,17 +260,21 @@ Menus = {

var html = document.createElement("div");
html.style = "width:100%; padding: 0.5em;"
html.innerHTML = currentcomment.split("\n").join("<br/>");
var value = currentcomment.split("\n").join("<br/>");
value = value.split("&").join("&amp;")
html.innerHTML = value;
html.contentEditable = true;
Dialog.open(html, function(){
var value = html.innerHTML.split("<br xmlns=\"http:https://www.w3.org/1999/xhtml\" />").join("\n");
let value = html.innerHTML.split("<br xmlns=\"http:https://www.w3.org/1999/xhtml\" />").join("\n");

value = value.split(" xmlns=\"http:https://www.w3.org/1999/xhtml\"").join("");
value = value.split("<div>").join("");
value = value.split("</div>").join("\n");
value = value.split("<br />").join("\n");
value = value.split("<br/>").join("\n");

value = value.split("&amp;").join("&");

annotation.annotationComment = value;
annotation.saveTx({skipSelect:true}).then(e=>{
Zotero.ZeNotes.Ui.reload();
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:name>ZeNotes</em:name>
<em:version>0.5.9</em:version>
<em:version>0.6.0</em:version>
<em:multiprocessCompatible>true</em:multiprocessCompatible>
<em:updateURL>https://raw.githubusercontent.com/frianasoa/zenotes/main/zenote-update.json</em:updateURL>
<em:homepageURL>https://github.com/frianasoa/zenotes</em:homepageURL>
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Ze Notes",
"version": "0.5.9",
"version": "0.6.0",
"description": "Advanced notes manager",
"homepage_url": "https://github.com/frianasoa/zenotes",
"author": "Fanantenana Rianasoa Andriariniaina",
Expand Down
6 changes: 3 additions & 3 deletions zenote-update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"[email protected]": {
"updates": [
{
"version": "0.5.9",
"update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.9/zenotes-v0.5.9.xpi",
"update_hash": "sha256:03f0e0fef1eda2a893fccb6a70fd55ab3f6565a8cb480f540fb257e3b11e9a65",
"version": "0.6.0",
"update_link": "https://github.com/frianasoa/Ze-Notes/releases/download/v0.6.0/zenotes-v0.6.0.xpi",
"update_hash": "sha256:ee5538f06c17b8b49e7b22ef06a84b1b08fe38f7d5e7eac172156150edce2359",
"applications": {
"gecko": {
"strict_min_version": "60.0"
Expand Down
6 changes: 3 additions & 3 deletions zenote-update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<ns1:version>0.5.9</ns1:version>
<ns1:version>0.6.0</ns1:version>
<ns1:targetApplication>
<rdf:Description>
<ns1:id>[email protected]</ns1:id>
<ns1:minVersion>5.0.0</ns1:minVersion>
<ns1:maxVersion>6.*</ns1:maxVersion>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.9/zenotes-v0.5.9.xpi</ns1:updateLink>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.6.0/zenotes-v0.6.0.xpi</ns1:updateLink>
</rdf:Description>
</ns1:targetApplication>

Expand All @@ -20,7 +20,7 @@
<ns1:id>[email protected]</ns1:id>
<ns1:minVersion>4.999</ns1:minVersion>
<ns1:maxVersion>6.*</ns1:maxVersion>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.5.9/zenotes-v0.5.9.xpi</ns1:updateLink>
<ns1:updateLink>https://github.com/frianasoa/Ze-Notes/releases/download/v0.6.0/zenotes-v0.6.0.xpi</ns1:updateLink>
</rdf:Description>
</ns1:targetApplication>

Expand Down

0 comments on commit fc25d30

Please sign in to comment.