added: color inline code and links
This commit is contained in:
parent
107a382b9c
commit
1cb23c7108
10
main.js
10
main.js
|
@ -2245,12 +2245,15 @@ function rawline2html(line, index, options)
|
||||||
.filter(s => s.command.startsWith(snippetpart))
|
.filter(s => s.command.startsWith(snippetpart))
|
||||||
.map(s => s.command.substring(1));
|
.map(s => s.command.substring(1));
|
||||||
|
|
||||||
|
if (matching.length)
|
||||||
|
{
|
||||||
line += "<span style='color:lightgrey'>";
|
line += "<span style='color:lightgrey'>";
|
||||||
line += matching.join().substr(pos - slashpos - 1);
|
line += matching.join().substr(pos - slashpos - 1);
|
||||||
line += "</span>";
|
line += "</span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// todo.txt
|
// todo.txt
|
||||||
if (currentistodo())
|
if (currentistodo())
|
||||||
|
@ -2266,6 +2269,13 @@ function rawline2html(line, index, options)
|
||||||
line = line.replace(/(\s\+\w*)/g, "<span style='color:grey'>$1</span>");
|
line = line.replace(/(\s\+\w*)/g, "<span style='color:grey'>$1</span>");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// inline code
|
||||||
|
line = line.replace(/`(.*)`/, "<span class='color-code'>`$1`</span>");
|
||||||
|
|
||||||
|
// links
|
||||||
|
line = line.replace(/(http[^\s]*)/, "<u>$1</u>");
|
||||||
|
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue