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

		set { update(text: newValue) }
	}
	
	var rawText: String { return textStorage.string }

	public override var description: String { return "RmdChunk type \(chunkType) of length \(textStorage.length)" }
	

	}

	override var rawText: String {
		// remove any attachment characters
		let ss = "\u{ef}"
		var str = textStorage.string.replacingOccurrences(of: ss, with: "")
		str = textStorage.string.replacingOccurrences(of: "\u{fffc}", with: "")
		return str
	}
}

