diff --git a/layouts/partials/processed-content.html b/layouts/partials/processed-content.html index cf44009..97f2798 100644 --- a/layouts/partials/processed-content.html +++ b/layouts/partials/processed-content.html @@ -60,7 +60,7 @@ -{{- $extraLanguageFigure := `
` -}}
-{{- $replacedLanguageFigure := `
` -}}
+{{- $extraLanguageFigure := `
<(code|samp) class="language-figure">` -}}
+{{- $replacedLanguageFigure := `
<${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 -}}
diff --git a/layouts/shortcodes/codefigure.html b/layouts/shortcodes/codefigure.html
index e64f768..3f768ad 100644
--- a/layouts/shortcodes/codefigure.html
+++ b/layouts/shortcodes/codefigure.html
@@ -8,5 +8,9 @@
 	just use the beginning for the label and the full thing for the aria description.
 -->
 
+{{ if .Get "samp" -}} +{{ .Inner | .Page.RenderString | replaceRE "" "" | safeHTML -}} +{{- else -}} {{ .Inner | .Page.RenderString -}} +{{- end }}
diff --git a/scripts/xhtmlize-single-file.sh b/scripts/xhtmlize-single-file.sh index a731873..5b73424 100644 --- a/scripts/xhtmlize-single-file.sh +++ b/scripts/xhtmlize-single-file.sh @@ -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 '\n\t*\n(?:[\t\s]*)?
' '
' \ + | sd '\n\t*<(code|samp) ' '
<$1 ' \
+		| sd '(?:\n)?\n(?:[\t\s]*)?
' '
' \ | sd '.span itemprop="familyName"' ' ' ' ' \ | sd '([a-z])<(data|time)' '$1 <$2'