mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Make code tags preserve whitespace
This commit is contained in:
parent
1d8fc18304
commit
15d7a2f021
1 changed files with 3 additions and 2 deletions
|
@ -22,7 +22,8 @@ MatrixText {
|
||||||
text: "
|
text: "
|
||||||
<style type=\"text/css\">
|
<style type=\"text/css\">
|
||||||
a { color:" + Nheko.colors.link + ";}
|
a { color:" + Nheko.colors.link + ";}
|
||||||
code { background-color: " + Nheko.colors.alternateBase + ";}
|
code { background-color: " + Nheko.colors.alternateBase + "; white-space: pre-wrap; }
|
||||||
|
pre { background-color: " + Nheko.colors.alternateBase + "; white-space: pre-wrap; }
|
||||||
table {
|
table {
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
@ -40,7 +41,7 @@ MatrixText {
|
||||||
background-color: " + Nheko.colors.text + ";
|
background-color: " + Nheko.colors.text + ";
|
||||||
}" : "") + // TODO(Nico): Figure out how to support mobile
|
}" : "") + // TODO(Nico): Figure out how to support mobile
|
||||||
"</style>
|
"</style>
|
||||||
" + formatted.replace(/<pre>/g, "<pre style='white-space: pre-wrap; background-color: " + Nheko.colors.alternateBase + "'>").replace(/<del>/g, "<s>").replace(/<\/del>/g, "</s>").replace(/<strike>/g, "<s>").replace(/<\/strike>/g, "</s>")
|
" + formatted.replace(/<del>/g, "<s>").replace(/<\/del>/g, "</s>").replace(/<strike>/g, "<s>").replace(/<\/strike>/g, "</s>")
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: !keepFullText ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : implicitHeight
|
height: !keepFullText ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : implicitHeight
|
||||||
clip: !keepFullText
|
clip: !keepFullText
|
||||||
|
|
Loading…
Reference in a new issue