Skip to content

Commit

Permalink
Bug fixes (#18)
Browse files Browse the repository at this point in the history
* Fixed an issue causing closing spoiler tags to be added to the markup preview
* Fixed an issue where the markup text was not displaying indentation for lists
* Removed some console logs
* Updated a few breaking changes for quill
  • Loading branch information
dons20 authored Jul 27, 2024
1 parent 3715bb4 commit cd5ce33
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
prepros.config
prepros.config
node_modules
14 changes: 7 additions & 7 deletions assets/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ window.addEventListener(
.replace(/<\/em>/g, "[/i]")
.replace(/<u>/g, "[u]")
.replace(/<\/u>/g, "[/u]")
.replace(/<ol>/g, "[olist]\n")
.replace(/<\/ol>/g, "[/olist]\n")
.replace(/<ul>/g, "[list]\n")
.replace(/<\/ul>/g, "[/list]\n")
.replace(/<li>/g, "[*]")
.replace(/<ol>/g, "")
.replace(/<\/ol>/g, "")
.replace(/((<li data-list="ordered">)(.*?)(<\/li>))+/g, `[olist]\n$&[/olist]`)
.replace(/((<li data-list="bullet">)(.*?)(<\/li>))+/g, `[list]\n$&[/list]`)
.replace(/<li (.*?)>/g, "\t[*]")
.replace(/<\/li>/g, "\n")
.replace(/<br>/g, "\n")
.replace(/<a href="/g, "[url=")
Expand All @@ -96,6 +96,7 @@ window.addEventListener(
.replace(/<\/s>/g, "[/strike]")
.replace(/<blockquote>/g, "[quote=author]")
.replace(/<\/blockquote>/g, "[/quote]\n")
.replace(/(<span class="ql-ui")(.*?)(<\/span>)/g, "")
.replace(/<span class="spoiler">/g, "[spoiler]")
.replace(/<\/span>/g, "[/spoiler]")
.replace(/<pre spellcheck="false">/g, "[code]")
Expand Down Expand Up @@ -146,7 +147,6 @@ window.addEventListener(
//Show Preview
$("#previewCollapse").on("show.bs.collapse", function () {
quill.blur();
console.log(text);
document.getElementById("showBtn").innerHTML = "Hide Preview";
});

Expand All @@ -169,7 +169,7 @@ window.addEventListener(
// Save periodically
setInterval(function () {
if (change.length() > 0) {
console.log("Saving changes", change);
// console.log("Saving changes", change);
change = new Delta();
}
}, 5 * 1000);
Expand Down
2 changes: 1 addition & 1 deletion assets/scripts.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 1 addition & 7 deletions assets/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit cd5ce33

Please sign in to comment.