hotfix: missing newlines in mined cards output
This commit is contained in:
1 parent
889ce35494
commit
e44bf6f311
2 files changed
+5
-3
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "nazeka",
|
"name": "nazeka",
|
||||||
"version": "0.1.9",
|
"version": "0.1.9.2",
|
||||||
"author": "Wareya",
|
"author": "Wareya",
|
||||||
"homepage_url": "https://github.com/wareya/nazeka",
|
"homepage_url": "https://github.com/wareya/nazeka",
|
||||||
"description": "A rikai replacement.",
|
"description": "A rikai replacement.",
|
||||||
|
|||||||
@@ -21,9 +21,10 @@ async function init_page()
|
|||||||
let data = (await browser.storage.local.get("cards")).cards;
|
let data = (await browser.storage.local.get("cards")).cards;
|
||||||
if(data)
|
if(data)
|
||||||
{
|
{
|
||||||
let text = "";
|
let fulltext = "";
|
||||||
for(let card of data)
|
for(let card of data)
|
||||||
{
|
{
|
||||||
|
let text = "";
|
||||||
text += card.front.replace(/\t/g, "\\t");
|
text += card.front.replace(/\t/g, "\\t");
|
||||||
text += "\t";
|
text += "\t";
|
||||||
text += card.readings.replace(/\t/g, "\\t");
|
text += card.readings.replace(/\t/g, "\\t");
|
||||||
@@ -47,9 +48,10 @@ async function init_page()
|
|||||||
text = text.replace(/\n/g, "\\n").replace(/\r/g, "");
|
text = text.replace(/\n/g, "\\n").replace(/\r/g, "");
|
||||||
console.log(text);
|
console.log(text);
|
||||||
text += "\n";
|
text += "\n";
|
||||||
|
fulltext += text;
|
||||||
}
|
}
|
||||||
let element = document.body.querySelector("#field");
|
let element = document.body.querySelector("#field");
|
||||||
element.textContent = text;
|
element.textContent = fulltext;
|
||||||
}
|
}
|
||||||
document.body.querySelector("#reset").addEventListener("click", ask_reset);
|
document.body.querySelector("#reset").addEventListener("click", ask_reset);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user