Some attempts to keep bold font width
This commit is contained in:
parent
4196b5b6b3
commit
11add81bf8
10
main.js
10
main.js
|
@ -2100,6 +2100,11 @@ function applycolors()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var boldstyle = "-webkit-text-stroke-width: 0.5px;";
|
||||||
|
//var boldstyle = "font-weight: bold; letter-spacing: 0;";
|
||||||
|
//var boldstyle = "font-weight: bold;";
|
||||||
|
//var boldstyle = "text-shadow: 0 0 0.01px black;";
|
||||||
|
|
||||||
var lines = md.value.split("\n");
|
var lines = md.value.split("\n");
|
||||||
var header = false;
|
var header = false;
|
||||||
var code = false;
|
var code = false;
|
||||||
|
@ -2113,7 +2118,7 @@ function applycolors()
|
||||||
if (line.startsWith("#"))
|
if (line.startsWith("#"))
|
||||||
{
|
{
|
||||||
line = line.replace(/(#* )/, "<span style='color:" + settings.accentcolor + "'>$1</span>"); // to check!
|
line = line.replace(/(#* )/, "<span style='color:" + settings.accentcolor + "'>$1</span>"); // to check!
|
||||||
line = "<b>" + line + "</b>";
|
line = "<span style='" + boldstyle + "'>" + line + "</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
// bold and italics
|
// bold and italics
|
||||||
|
@ -2122,8 +2127,9 @@ function applycolors()
|
||||||
{
|
{
|
||||||
temp = line.substring(2);
|
temp = line.substring(2);
|
||||||
}
|
}
|
||||||
temp = temp.replace(/\*\*([^\*]*)\*\*/g, "<b>**$1**</b>");
|
temp = temp.replace(/\*\*([^\*]*)\*\*/g, "<span style='" + boldstyle + "'>**$1**</span>");
|
||||||
temp = temp.replace(/\*([^\*]*)\*/g, "<em>*$1*</em>");
|
temp = temp.replace(/\*([^\*]*)\*/g, "<em>*$1*</em>");
|
||||||
|
|
||||||
if (line.startsWith("* "))
|
if (line.startsWith("* "))
|
||||||
{
|
{
|
||||||
line = "* " + temp;
|
line = "* " + temp;
|
||||||
|
|
Loading…
Reference in New Issue