diff --git a/assets/scss/support.scss b/assets/scss/support.scss index 36f6866e5dad2ae082ffbf15cb4d153dc0fba697..c27860e7848102ba99173d76f8fec99b2222a9e9 100755 --- a/assets/scss/support.scss +++ b/assets/scss/support.scss @@ -82,3 +82,14 @@ section { .salute { padding-left: 1em; } + +.sup { + vertical-align: super; + font-size: smaller; +} + +.left { + display: inline; + text-align: left; +} + diff --git a/src/Service/TranscriptionService.php b/src/Service/TranscriptionService.php index 54d8f3007d9f555fd1550649ab778b719cbce8ee..9cab5f8a2df46e24737a474796c2e715e4ceb345 100644 --- a/src/Service/TranscriptionService.php +++ b/src/Service/TranscriptionService.php @@ -90,4 +90,28 @@ class TranscriptionService extends CommonTransformService $htmlEl->appendChild($doc->text('] ')); return $htmlEl; } + + private function handleHi(DOMElement $el): DOMNode + { + $htmlEl = $this->span(); + if ('hi' === $el->nodeName && isset($el->attributes[0])) { + foreach ($el->attributes as $attribute) { + + $hi = explode(':', $attribute->value); + + if (isset($hi[1]) && !empty($hi[1]) && 'italic' === $hi[1]) { + + $htmlEl->setAttribute('class', 'italic'); + } + elseif (isset($hi[1]) && !empty($hi[1]) && 'underline' === $hi[1]) { + $htmlEl->setAttribute('class', 'underline'); + } + elseif (isset($hi[1]) && !empty($hi[1]) && 'centre' === $hi[1]) { + $htmlEl = $this->p(); + $htmlEl->setAttribute('class', 'left'); + } + } + } + return $htmlEl; + } }