6 Commits

Author SHA1 Message Date
20038e290a Fix width of pre element 2025-09-20 20:55:21 +02:00
52b49e18a2 Fix link regexp 2025-09-20 18:59:36 +02:00
5036b3bca6 Changed font size 2025-09-20 18:53:00 +02:00
5063c088eb Fixed margins 2025-09-20 18:52:22 +02:00
acd6ed63e1 Add leading space to links 2025-09-20 18:51:03 +02:00
8b3c7871ab Add color to links 2025-09-20 18:50:38 +02:00
2 changed files with 23 additions and 8 deletions

View File

@@ -304,9 +304,10 @@ class Link extends Symbol {
/**
* @type {RegExp}
*/
static textAndLinkRegExp: RegExp = new RegExp(
/\[(?<text>.*)\]\((?<link>.*)\)/
);
static textAndLinkRegExp: RegExp = new RegExp
(
/\[(?<text>[^\]]+)\]\((?<link>[^)]+)\)/
);
/**
* @type {string}
*/
@@ -350,7 +351,8 @@ class Link extends Symbol {
}
render() {
return `<a href="${this.link}">${this.text}</a>`;
// TODO: This leading space should probably be somewhere else.
return ` <a href="${this.link}">${this.text}</a>`;
}
}
@@ -899,7 +901,7 @@ export const toHtml = (markdown: string, assetDirectory: string): string => {
// .filter((s) => !(s instanceof JustALineBreak))
.map((s) => s.render())
.join("");
return `<div>${html}</div>`;
return `<div class="content">${html}</div>`;
};
/**

View File

@@ -8,7 +8,7 @@
<style>
html {
font-family: monospace;
font-size: 17px;
font-size: 18px;
display: flex;
justify-content: center;
align-items: center;
@@ -23,12 +23,16 @@
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
}
pre {
box-sizing: border-box;
border: 1px solid #00FFFF;
padding: 1rem;
width: fit-content;
max-width: 100%;
white-space: normal;
}
img {
@@ -37,7 +41,6 @@
}
p {
margin: 20px;
margin-top: 20px;
margin-bottom: 0px;
}
@@ -63,7 +66,7 @@
h4,
h5,
h6 {
margin: 20px;
margin-top: 20px;
margin-bottom: 0px;
text-transform: capitalize;
line-height: 32px;
@@ -118,6 +121,16 @@
margin-left: 10px;
}
}
a {
color: #00FFFF;
}
.content {
display: flex;
flex-direction: column;
flex: 1;
}
</style>
</head>