Skip to content

Commit

Permalink
Merge pull request #47 from GeekTree0101/bug/fix-invalid-merge-issue
Browse files Browse the repository at this point in the history
Fix Invalid Merge Issue
  • Loading branch information
GeekTree0101 authored Jan 30, 2019
2 parents c6735ed + b307eda commit 48f4c5e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Example/VEditorKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
607FACEB1AFB9204008FA782 /* VEditorParserSpec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VEditorParserSpec.swift; sourceTree = "<group>"; };
678C76B2ADE22C77779D368C /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = "<group>"; };
9B3036D921F4162D00489340 /* UIImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+Extension.swift"; sourceTree = "<group>"; };
9B3036E121F41BAF00489340 /* MockService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = MockService.swift; path = /Users/vingle/Desktop/VEditorKit/Example/VEditorKit/Services/MockService.swift; sourceTree = "<absolute>"; };
9B3036E121F41BAF00489340 /* MockService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockService.swift; sourceTree = "<group>"; };
9B3036E421F41BBE00489340 /* XMLViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = XMLViewController.swift; sourceTree = "<group>"; };
9B3036E621F41BC800489340 /* EditorOpenGraphPlaceholder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorOpenGraphPlaceholder.swift; sourceTree = "<group>"; };
9B3036EA21F41C3800489340 /* VImageContent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VImageContent.swift; sourceTree = "<group>"; };
Expand Down
14 changes: 7 additions & 7 deletions VEditorKit/Classes/VEditorNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@ open class VEditorNode: ASDisplayNode, ASTableDelegate, ASTableDataSource {
.subscribe(onNext: { [weak self] indexPath in
self?.editorContents.remove(at: indexPath.row)
self?.tableNode.deleteRows(at: [indexPath], with: .automatic)
self?.mergeTextContents(target: .init(row: indexPath.row - 1,
section: indexPath.section),
to: indexPath,
self?.mergeTextContents(target: indexPath,
to: .init(row: indexPath.row - 1,
section: indexPath.section),
animated: false)
})
.disposed(by: cellNode.disposeBag)
Expand Down Expand Up @@ -589,12 +589,12 @@ open class VEditorNode: ASDisplayNode, ASTableDelegate, ASTableDataSource {
}

// NOTE: make merged attributedText
var mutableAttrText = NSMutableAttributedString(attributedString: targetAttributedText)
var mutableAttrText = NSMutableAttributedString(attributedString: sourceAttributedText)
var newlineAttribute = self.editorRule.defaultAttribute()
newlineAttribute[VEditorAttributeKey] = [self.editorRule.defaultStyleXMLTag]
mutableAttrText.append(NSAttributedString.init(string: "\n",
attributes: newlineAttribute))
mutableAttrText.append(sourceAttributedText)
mutableAttrText.append(targetAttributedText)

// NOTE: update editor
self.editorContents.remove(at: target.row)
Expand Down Expand Up @@ -629,8 +629,8 @@ open class VEditorNode: ASDisplayNode, ASTableDelegate, ASTableDataSource {
.nodeForRow(at: .init(row: indexPath.row,
section: indexPath.section)) as? VEditorTextCellNode

guard let target = beforeCell?.indexPath,
let to = currentCell?.indexPath else {
guard let target = currentCell?.indexPath,
let to = beforeCell?.indexPath else {
return
}

Expand Down
4 changes: 2 additions & 2 deletions VEditorKit/Classes/VEditorParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ public final class VEditorParser: NSObject, XMLStyler {
Editor Content Parser

General pattern would be:
xml: <content><p>hello <b>world</b></p><img src="~~~~" /><p>done></p></content>
xml: <content><p>hello <b>world</b></p><img src="~~~~" /><p>done</p></content>
will convert to
- [0]: <p>hello <b>world</b></p>
- [1]: VEditorMediaContent
- [2]: <p>done></p>
- [2]: <p>done</p>
*/
internal class VEditorContentParser: NSObject, XMLParserDelegate {

Expand Down

0 comments on commit 48f4c5e

Please sign in to comment.