Support superscript formatting

This commit is contained in:
Marty-D
2016-05-27 14:44:27 -04:00
parent 20a1eaf4ba
commit 0d0849a4b4
2 changed files with 4 additions and 0 deletions

View File

@@ -624,6 +624,9 @@ var Tools = {
// **bold**
str = str.replace(/\*\*([^< ](?:[^<]*?[^< ])??)\*\*/g,
options.hidebold ? '$1' : '<b>$1</b>');
// ^^superscript^^
str = str.replace(/\^\^([^< ](?:[^<]*?[^< ])??)\^\^/g,
options.hidesuperscript ? '$1' : '<sup>$1</sup>');
if (!options.hidespoiler) {
var untilIndex = 0;

View File

@@ -577,6 +577,7 @@
buf += '<p><label class="optlabel"><input type="checkbox" name="italics" ' + (cur.hideitalics ? 'checked' : '') + ' /> Suppress __<em>italics</em>__</label></p>';
buf += '<p><label class="optlabel"><input type="checkbox" name="monospace" ' + (cur.hidemonospace ? 'checked' : '') + ' /> Suppress ``<code>code formatting</code>``</label></p>';
buf += '<p><label class="optlabel"><input type="checkbox" name="strikethrough" ' + (cur.hidestrikethrough ? 'checked' : '') + ' /> Suppress ~~<s>strikethrough</s>~~</label></p>';
buf += '<p><label class="optlabel"><input type="checkbox" name="superscript" ' + (cur.hidesuperscript ? 'checked' : '') + ' /> Suppress ^^<sup>superscript</sup>^^</label></p>';
buf += '<p><label class="optlabel"><input type="checkbox" name="me" ' + (cur.hideme ? 'checked' : '') + ' /> Suppress <kbd>/me</kbd> <em>action formatting</em></label></p>';
buf += '<p><label class="optlabel"><input type="checkbox" name="greentext" ' + (cur.hidegreentext ? 'checked' : '') + ' /> Suppress <span class="greentext">&gt;' + ['meme arrows', 'greentext', 'quote formatting'][Math.floor(Math.random() * 3)] + '</span></label></p>';
buf += '<p><label class="optlabel"><input type="checkbox" name="spoiler" ' + (cur.hidespoiler ? 'checked' : '') + ' /> Suppress spoiler hiding</label></p>';