mirror of
https://git.sr.ht/~seirdy/seirdy.one
synced 2024-11-27 14:12:09 +00:00
Re-add support for <samp> in markdown
This commit is contained in:
parent
ae0661bb7a
commit
a4bcf9c4dd
3 changed files with 8 additions and 4 deletions
|
@ -60,7 +60,7 @@
|
|||
|
||||
|
||||
<!--Since language-figure doesn't seem to work for some reason just use regex to replace it-->
|
||||
{{- $extraLanguageFigure := `<pre><code class="language-figure">` -}}
|
||||
{{- $replacedLanguageFigure := `<pre tabindex="0"><code translate="no" itemprop="text">` -}}
|
||||
{{- $extraLanguageFigure := `<pre><(code|samp) class="language-figure">` -}}
|
||||
{{- $replacedLanguageFigure := `<pre tabindex="0"><${1} translate="no" itemprop="text">` -}}
|
||||
|
||||
{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $badNoteRef $goodNoteRef | replaceRE $endnotesClosingDiv $endnotesClosingSection | replaceRE $combinedTerm $splitTerm | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | replaceRE $endNotesNotFocusable $endNotesFocusable | replaceRE $extraLanguageFigure $replacedLanguageFigure | replaceRE `\’` `’` | replaceRE `\ ` ` ` | replaceRE `\“` `“` | replaceRE `\”` `”` | replaceRE `\…` `—` | replaceRE `\—` `—` | replaceRE `\­` `­` | replaceRE `‘` `‘`| safeHTML -}}
|
||||
|
|
|
@ -8,5 +8,9 @@
|
|||
just use the beginning for the label and the full thing for the aria description.
|
||||
-->
|
||||
<figure aria-labelledby="{{ $id }}" itemprop="hasPart" itemscope="" itemtype="https://schema.org/SoftwareSourceCode">
|
||||
{{ if .Get "samp" -}}
|
||||
{{ .Inner | .Page.RenderString | replaceRE "<code" "<samp" | replaceRE "</code>" "</samp>" | safeHTML -}}
|
||||
{{- else -}}
|
||||
{{ .Inner | .Page.RenderString -}}
|
||||
{{- end }}
|
||||
</figure>
|
||||
|
|
|
@ -31,8 +31,8 @@ sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - | sd '^\t' '' >"
|
|||
cat tmp.css
|
||||
# shellcheck disable=SC2016 # these are regex statements, not shell expressions
|
||||
tail -n +8 "$tmp_file" \
|
||||
| sd '<pre(?: tabindex="0")?>\n\t*<code ' '<pre tabindex="0"><code ' \
|
||||
| sd '(?:\n)?</code>\n(?:[\t\s]*)?</pre>' '</code></pre>' \
|
||||
| sd '<pre(?: tabindex="0")?>\n\t*<(code|samp) ' '<pre tabindex="0"><$1 ' \
|
||||
| sd '(?:\n)?</(code|samp)>\n(?:[\t\s]*)?</pre>' '</$1></pre>' \
|
||||
| sd '</span>.span itemprop="familyName"' '</span> <span itemprop="familyName"' \
|
||||
| sd '</picture><span itemprop="name" class="p-name fn n">' '</picture> <span itemprop="name" class="p-name fn n">' \
|
||||
| sd '([a-z])<(data|time)' '$1 <$2'
|
||||
|
|
Loading…
Reference in a new issue