Skip to content

Commit

Permalink
Maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
taufik-nurrohman committed Sep 11, 2022
1 parent 48e7d67 commit 1101a54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tweak/alter.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
};

function replaceToEmoji() {
editor.match(/^\s*:\w+:\s*$/, function(m) {
editor.match(/^\s*:\w+:\s*$/, function (m) {
console.log(m);
let exists = maps[m[0] = m[0] ? m[0].trim() : ""];
if (exists) {
Expand Down
2 changes: 1 addition & 1 deletion tweak/paste.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<script src="../index.min.js"></script>
<script>
const editor = new TE(document.querySelector('textarea'));
editor.self.addEventListener('paste', function() {
editor.self.addEventListener('paste', function () {
let {
after,
before
Expand Down
6 changes: 3 additions & 3 deletions tweak/toggle.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
function toggle(name) {
let patternBefore = new RegExp('<' + name + '(?:\\s[^>]*)?>$'),
patternAfter = new RegExp('^<\\/' + name + '>');
editor.match([patternBefore, /.*/, patternAfter], function(before, value, after) {
editor.match([patternBefore, /.*/, patternAfter], function (before, value, after) {
if (before[0] && after[0]) {
this.replace(patternBefore, "", -1);
this.replace(patternAfter, "", 1);
Expand All @@ -31,7 +31,7 @@
function toggleBlocks() {
let patternBefore = /<(?:p|h([1-6]))(\s[^>]*)?>$/,
patternAfter = /^<\/(?:p|h[1-6])>/;
editor.match([patternBefore, /.*/, patternAfter], function(before, value, after) {
editor.match([patternBefore, /.*/, patternAfter], function (before, value, after) {
let h = +(before[1] || 0),
attr = before[2] || "";
// ``
Expand All @@ -56,7 +56,7 @@
function toggleCodes() {
let patternBefore = /<(?:pre|code)(?:\s[^>]*)?>(?:\s*<code(?:\s[^>]*)?>)?$/,
patternAfter = /^(?:<\/code>\s*)?<\/(?:pre|code)>/;
editor.match([patternBefore, /.*/, patternAfter], function(before, value, after) {
editor.match([patternBefore, /.*/, patternAfter], function (before, value, after) {
// ``
this.replace(patternBefore, "", -1);
this.replace(patternAfter, "", 1);
Expand Down

0 comments on commit 1101a54

Please sign in to comment.