1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-27 14:12:09 +00:00

Add missing tabindex

This commit is contained in:
Rohan Kumar 2022-06-02 13:14:20 -07:00
parent 449a1be659
commit b02a619260
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479
2 changed files with 5 additions and 5 deletions

View file

@ -52,7 +52,7 @@
<!--Since language-figure doesn't seem to work for some reason just use regex to replace it--> <!--Since language-figure doesn't seem to work for some reason just use regex to replace it-->
{{- $extraLanguageFigure := `<code class="language-figure">` -}} {{- $extraLanguageFigure := `<pre><code class="language-figure">` -}}
{{- $replacedLanguageFigure := `<code translate="no" itemprop="text">` -}} {{- $replacedLanguageFigure := `<pre tabindex="0"><code translate="no" itemprop="text">` -}}
{{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $badNoteRef $goodNoteRef | replaceRE $endnotesClosingDiv $endnotesClosingSection | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | replaceRE $endNotesNotFocusable $endNotesFocusable | replaceRE `\&rsquo;` `` | replaceRE `\&nbsp;` `\&#160;` | replaceRE `\&ldquo;` `“` | replaceRE `\&rdquo;` `”` | replaceRE `\&hellip;` `—` | replaceRE `\&mdash;` `—` | replaceRE `\&shy;` `\&#173;` | replaceRE `&lsquo;` ``| safeHTML -}} {{- .Content | replaceRE $referencesWithoutHeading $referencesWithHeading | replaceRE $badNoteRef $goodNoteRef | replaceRE $endnotesClosingDiv $endnotesClosingSection | replaceRE $tocHeadingOutside $tocHeadingInside | replaceRE $footnoteBacklinksBad $footnoteBacklinksGood | replaceRE $repeatedFootnoteBacklinksBad $repeatedFootnoteBacklinksGood | replaceRE $endNotesNotFocusable $endNotesFocusable | replaceRE $extraLanguageFigure $replacedLanguageFigure | replaceRE `\&rsquo;` `` | replaceRE `\&nbsp;` `\&#160;` | replaceRE `\&ldquo;` `“` | replaceRE `\&rdquo;` `”` | replaceRE `\&hellip;` `—` | replaceRE `\&mdash;` `—` | replaceRE `\&shy;` `\&#173;` | replaceRE `&lsquo;` ``| safeHTML -}}

View file

@ -28,8 +28,8 @@ sed 7d "$html_file" | xmllint --format --encode UTF-8 --noent - -o "$tmp_file"
head -n7 "$tmp_file" >> "$xhtml_file" head -n7 "$tmp_file" >> "$xhtml_file"
cat tmp.css >>"$xhtml_file" cat tmp.css >>"$xhtml_file"
tail -n +8 "$tmp_file" \ tail -n +8 "$tmp_file" \
| sd '<pre>\n\t*<code ' '<pre><code ' \ | sd '<pre(?: tabindex="0")?>\n\t*<code ' '<pre tabindex="0"><code ' \
| sd '(?:\n)</code>\n\t*</pre>' '</code></pre>' >>"$xhtml_file" | sd '(?:\n)?</code>\n(?:[\t\s]*)?</pre>' '</code></pre>' >>"$xhtml_file"
tail -n +2 "$xhtml_file" > "$html_file" tail -n +2 "$xhtml_file" > "$html_file"
sed -i 5d "$xhtml_file" # busybox sed supports "-i" sed -i 5d "$xhtml_file" # busybox sed supports "-i"