1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-09-19 20:02:10 +00:00

Fix whitespace with XHTML parser

Remove leading whitespace in codeblocks that only appears when using
browser XHTML parsers for some reason.
This commit is contained in:
Rohan Kumar 2023-12-03 23:47:35 -08:00
parent 319051e126
commit 1eedc95339
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -52,5 +52,5 @@ sed 7d "$html_file" | run_xmllint | tail -n +2 >"$tmp_file"
-e 's#</span>(<a[^>]*rel="(nofollow ugc|ugc nofollow)"([^>]*)?>liked</a>)#</span> \1#' \ -e 's#</span>(<a[^>]*rel="(nofollow ugc|ugc nofollow)"([^>]*)?>liked</a>)#</span> \1#' \
-e 's#^[\t\s]*<(code|/pre)#<\1#' \ -e 's#^[\t\s]*<(code|/pre)#<\1#' \
"$tmp_file" \ "$tmp_file" \
| awk '/^<\/code>/{printf "%s",$0;next}7' | awk '/(^<\/code>|<pre tabindex="0">)/{printf "%s",$0;next}7'
} >"$html_file" } >"$html_file"