Skip to content

Commit 1c97c6c

Browse files
committed
Fix CSS for defining the image style.
1 parent 3e206ca commit 1c97c6c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Sources/MarkdownKit/AttributedString/AttributedStringGenerator.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,15 +405,13 @@ open class AttributedStringGenerator {
405405
open var imgStyle: String {
406406
if let maxWidth = self.maxImageWidth {
407407
if let maxHeight = self.maxImageHeight {
408-
return "max-width: \(maxWidth);max-height: \(maxHeight); " +
409-
"!important;width: auto;height: auto;"
408+
return "max-width: \(maxWidth) !important;max-height: \(maxHeight) !important;" +
409+
"width: auto;height: auto;"
410410
} else {
411-
return "max-width: \(maxWidth);max-height: 100%; " +
412-
"!important;width: auto;height: auto;"
411+
return "max-height: 100%;max-width: \(maxWidth) !important;width: auto;height: auto;"
413412
}
414413
} else if let maxHeight = self.maxImageHeight {
415-
return "max-width: 100%;max-height: \(maxHeight); " +
416-
"!important;width: auto;height: auto;"
414+
return "max-width: 100%;max-height: \(maxHeight) !important;width: auto;height: auto;"
417415
} else {
418416
return ""
419417
}

0 commit comments

Comments
 (0)