Skip to content

Commit ba57c9d

Browse files
committed
Merge branch 'release/1.7.0'
2 parents 5367dbf + 986b84b commit ba57c9d

6 files changed

Lines changed: 14 additions & 7 deletions

File tree

Aztec/Classes/Libxml2/DOM/Data/ElementNode.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public class ElementNode: Node {
255255
/// - Returns: Returns `true` if it can be the last one, false otherwise.
256256
///
257257
func canBeLastInTree() -> Bool {
258-
return hasAttributes() || type == .li
258+
return hasAttributes() || isBlockLevel()
259259
}
260260

261261
/// Find out if this is a block-level element.

Aztec/Classes/TextKit/TextStorage.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,10 @@ open class TextStorage: NSTextStorage {
369369
open func getHTML(prettify: Bool = false, range: NSRange) -> String {
370370
return htmlConverter.html(from: self.attributedSubstring(from: range), prettify: prettify)
371371
}
372+
373+
open func getHTML(prettify: Bool = false, from attributedString: NSAttributedString) -> String {
374+
return htmlConverter.html(from: attributedString, prettify: prettify)
375+
}
372376

373377
func setHTML(_ html: String, defaultAttributes: [NSAttributedString.Key: Any]) {
374378
let originalLength = length

Aztec/Classes/TextKit/TextView.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,13 @@ open class TextView: UITextView {
226226
var defaultMissingImage: UIImage
227227

228228
fileprivate var defaultAttributes: [NSAttributedString.Key: Any] {
229-
let attributes: [NSAttributedString.Key: Any] = [
229+
var attributes: [NSAttributedString.Key: Any] = [
230230
.font: defaultFont,
231-
.paragraphStyle: defaultParagraphStyle
231+
.paragraphStyle: defaultParagraphStyle,
232232
]
233-
233+
if let color = textColor {
234+
attributes[.foregroundColor] = color
235+
}
234236
return attributes
235237
}
236238

Example/Example/EditorDemoController.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ class EditorDemoController: UIViewController {
324324
textView.accessibilityLabel = accessibilityLabel
325325
textView.font = Constants.defaultContentFont
326326
textView.keyboardDismissMode = .interactive
327-
textView.textColor = UIColor.darkText
327+
textView.textColor = UIColor(red: 0x1A/255.0, green: 0x1A/255.0, blue: 0x1A/255.0, alpha: 1)
328+
textView.linkTextAttributes = [.foregroundColor: UIColor(red: 0x01 / 255.0, green: 0x60 / 255.0, blue: 0x87 / 255.0, alpha: 1), NSAttributedString.Key.underlineStyle: NSNumber(value: NSUnderlineStyle.single.rawValue)]
328329
}
329330

330331
private func registerAttachmentImageProviders() {

WordPress-Aztec-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'WordPress-Aztec-iOS'
11-
s.version = '1.6.6'
11+
s.version = '1.7.0'
1212
s.summary = 'The native HTML Editor.'
1313

1414
# This description is used to generate tags and improve search results.

WordPress-Editor-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'WordPress-Editor-iOS'
11-
s.version = '1.6.6'
11+
s.version = '1.7.0'
1212
s.summary = 'The WordPress HTML Editor.'
1313

1414
# This description is used to generate tags and improve search results.

0 commit comments

Comments
 (0)