Rework storage structs, link preview
This commit is contained in:
@ -3,9 +3,16 @@ struct ModelViewer {
|
||||
|
||||
let file: String
|
||||
|
||||
let description: String
|
||||
let description: String?
|
||||
|
||||
private var imageAltText: String {
|
||||
guard let description else {
|
||||
return ""
|
||||
}
|
||||
return " alt='\(description.htmlEscaped())'"
|
||||
}
|
||||
|
||||
var content: String {
|
||||
"<model-viewer alt='\(description)' src='\(file)' ar shadow-intensity='1' camera-controls touch-action='pan-y'></model-viewer>"
|
||||
"<model-viewer\(imageAltText) src='\(file)' ar shadow-intensity='1' camera-controls touch-action='pan-y'></model-viewer>"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user