feat(exercises): update inline media functionality and version bump to 0.8.63
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 24s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 7s
Test Suite / playwright-tests (push) Successful in 30s
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 24s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 7s
Test Suite / playwright-tests (push) Successful in 30s
- Incremented application version to 0.8.63 and updated changelog with new features. - Enhanced inline media handling in the Rich Text Editor, including support for captions. - Introduced new CSS styles for improved media display and layout in the editor. - Replaced `ExerciseMediaEmbed` with `ExerciseAttachmentMediaStrip` for better media management in exercise content.
This commit is contained in:
1 parent
311a106d93
commit
337f29401b
13 files changed
+887
-429
No files matched your search
@@ -3,6 +3,8 @@
|
||||
* Restriktiver als sanitizeTrainerHtml: Allowlist für XSS-Minimierung.
|
||||
*/
|
||||
|
||||
import { sanitizeInlineMediaCaption } from './inlineMediaCaption'
|
||||
|
||||
const ALLOWED_BLOCK = new Set(['p', 'div', 'br', 'ul', 'ol', 'li', 'h3'])
|
||||
const ALLOWED_INLINE = new Set(['b', 'strong', 'i', 'em', 'u', 'span', 'a'])
|
||||
|
||||
@@ -38,6 +40,11 @@ function sanitizeAttributes(el, tagLower) {
|
||||
if (sz && _SIZE_OK.has(sz)) {
|
||||
out.setAttribute('data-shinkan-exercise-media-size', sz)
|
||||
}
|
||||
const capRaw = el.getAttribute('data-shinkan-exercise-media-caption')
|
||||
if (capRaw != null && String(capRaw).trim()) {
|
||||
const cap = sanitizeInlineMediaCaption(String(capRaw))
|
||||
if (cap) out.setAttribute('data-shinkan-exercise-media-caption', cap)
|
||||
}
|
||||
const cls = (el.getAttribute('class') || '').trim().split(/\s+/).filter(Boolean)
|
||||
const keep = cls.filter((c) => c === 'shinkan-inline-media')
|
||||
if (keep.length) out.setAttribute('class', keep.join(' '))
|
||||
|
||||
Reference in new issue
Block a user