 		set { update(text: newValue) }
 	}
 	
-	var rawText: String { return textStorage.string }
+	// remove any text attachments from the string
+	var rawText: String {
+		return textStorage.string.replacingOccurrences(of: "\u{0ffe}", with: "")
+	}
 
 	public override var description: String { return "RmdChunk type \(chunkType) of length \(textStorage.length)" }
 	

	private func attach(chunk: InlineChunk, to storage: NSTextStorage) {
		let attach = InlineAttachment()
		attach.chunk = chunk
		let image = chunk is Equation ? #imageLiteral(resourceName: "inlineEquation") : #imageLiteral(resourceName: "inlineCode")
		let acell = InlineAttachmentCell(imageCell: image)
		attach.bounds = CGRect(origin: CGPoint(x: 0, y: -5), size: acell.image!.size)
		attach.attachmentCell = acell
		storage.append(NSAttributedString(attachment: attach))
	}
	

		let pchunk = DocumentChunk(chunkType: .equation, docType: .latex, equationType: .inline,
								   range: documentRange, innerRange: range, chunkNumber: 1)
		super.init(parser: parser, chunk: pchunk)
		let chunkText = parser.textStorage.attributedSubstring(from: documentRange)
		update(text: chunkText)
	}
}

