Fix some things

This commit is contained in:
Jacob 2023-07-16 15:05:35 +02:00
parent 939be3a600
commit 3fded8e384
4 changed files with 4 additions and 13 deletions

View file

@ -402,7 +402,7 @@ be a LOT better for security, but this is good enough for me.
If you want to read more about why I like Ungoogled Chromium, check
out my article titled
[[Ungoogled Chromium - The best browser for most people]].
[Ungoogled Chromium - The best browser for most people](https://speedie.site/blog/Ungoogled+Chromium+-+The+best+browser+for+most+people).
## PDFs

View file

@ -62,7 +62,7 @@ or not. You know, to check if X or Wayland is used. The brainlet way to do
this would be something like this:
```Bash
if \[[ -n "$DISPLAY" \]]; then
if [[ -n "$DISPLAY" ]]; then
x=true
fi
```

View file

@ -183,23 +183,14 @@ function toHTML($inText) {
$postPart = explode('#', $linkedPost)[0]; // split away an eventual anchor part
$linkedFilename = fileNameForPost(sanitizeFilename($postPart));
$exists = file_exists($linkedFilename);
$outHTML = str_replace("[[$fullLinkText]]",
postLink($linkedPost, $linkText, ($exists? "" : " class=\"noexist\"")), $outHTML);
}
$outHTML = preg_replace("/\{\{(.*?)\}\}/", "<img src=\"" . BASE_URI . "/images/\\1\" alt=\"\\1\" />", $outHTML);
preg_match_all("/<h([1-4])>(.*?)<\/h\\1>/", $outHTML, $matches, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($matches[0]); $i++) {
$prefix = "<h".$matches[1][$i].">";
$caption = $matches[2][$i];
$suffix = substr_replace($prefix, "/", 1, 0);
/*
$outHTML = str_replace("$prefix$caption$suffix",
"$prefix<a id=\"".toHTMLID($caption)."\">$caption</a>$suffix", $outHTML);
*/
}
return $outHTML;

View file

@ -72,7 +72,7 @@ I'm telling you this. Let's say you want to check if $DISPLAY is defined
or not. You know, to check if X or Wayland is used. The brainlet way to do
this would be something like this:</p>
<pre><code class="Bash">if \<a href="/blog.php/+-n+%22%24DISPLAY%22+-" class="noexist"> -n "$DISPLAY" \</a>; then
<pre><code class="Bash">if [[ -n "$DISPLAY" ]]; then
x=true
fi
</code></pre>
@ -969,7 +969,7 @@ be a LOT better for security, but this is good enough for me.</p>
<p>If you want to read more about why I like Ungoogled Chromium, check
out my article titled
<a href="/blog.php/Ungoogled+Chromium+-+The+best+browser+for+most+people">Ungoogled Chromium - The best browser for most people</a>.</p>
<a href="https://speedie.site/blog/Ungoogled+Chromium+-+The+best+browser+for+most+people">Ungoogled Chromium - The best browser for most people</a>.</p>
<h2>PDFs</h2>