Skip to content
Snippets Groups Projects
Commit dbb7c37c authored by FCGudder's avatar FCGudder
Browse files

Speed optimisation for <<span>>

parent c2eb35b2
No related branches found
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ Macro.add('span', { ...@@ -11,7 +11,7 @@ Macro.add('span', {
tags : null, tags : null,
handler() { handler() {
const payload = this.payload[0].contents.replace(/\n$/, ''); const payload = this.payload[0].contents.replace(/(^\n+|\n+$)/, '');
let statement = this.args.raw.trim(); let statement = this.args.raw.trim();
let result; let result;
...@@ -27,10 +27,8 @@ Macro.add('span', { ...@@ -27,10 +27,8 @@ Macro.add('span', {
Config.debug && this.debugView.modes({block: true}); Config.debug && this.debugView.modes({block: true});
payload.replace(/^\n/, ''); jQuery("<span id='" + String(result) + "' />")
let span = jQuery(document.createElement('span')) .wiki(payload)
.prop('id', String(result))
.appendTo(this.output); .appendTo(this.output);
span.wiki(payload);
} }
}); });
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment