Skip to content
Snippets Groups Projects
Commit 267b7312 authored by echicken's avatar echicken
Browse files

Advance item number when going up one level and adding a new item to

an ordered list.
Chomp whitespace from bold/italic/underline/monospace text.
parent 7131ee75
No related branches found
No related tags found
No related merge requests found
......@@ -156,13 +156,13 @@ WikiMarkup.prototype.html_tag_format = function (tag, attributes) {
WikiMarkup.prototype.render_text_console = function (text) {
const self = this;
return text.replace(/\*\*([^\*]+)\*\*/g, function (m, c) {
return '\1+' + self.config.console.bold_style + c + '\1-';
return '\1+' + self.config.console.bold_style + skipsp(truncsp(c)) + '\1-';
}).replace(/\/\/([^\/]+)\/\//g, function (m, c) {
return '\1+' + self.config.console.italic_style + c + '\1-';
return '\1+' + self.config.console.italic_style + skipsp(truncsp(c)) + '\1-';
}).replace(/__([^_]+)__/g, function (m, c) {
return '\1+' + self.config.console.underline_style + c + '\1-';
return '\1+' + self.config.console.underline_style + skipsp(truncsp(c)) + '\1-';
}).replace(/''([^']+)''/g, function (m, c) {
return c;
return skipsp(truncsp(c));
}).replace(/\{\{(.+)\}\}/g, function (m, c) {
c = c.split('|');
self.state.images.push({ text : (c[1] || c[0]), link : c[0] });
......@@ -302,6 +302,7 @@ WikiMarkup.prototype.render_line_console = function (line) {
} else if (match[1].length < this.state.list_level) {
if (lt == 'ol') this.state.list_stack.splice(this.state.list_level, 1);
this.state.list_level = match[1].length;
if (lt == 'ol') this.state.list_stack[this.state.list_level]++;
} else if (lt == 'ol') {
if (typeof this.state.list_stack[this.state.list_level] != 'number') {
this.state.list_stack[this.state.list_level] = 0;
......
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