                              opacity: opacity, fontName: fontName, fontSize: fontSize, fontWeight: fontWeight, bounds: Rect(x: bounds.x, y: bounds.y, w: bounds.w + text.bounds.w, h: bounds.h))
     }
 
-    fileprivate func parseTspan(_ tspan: XMLIndexer, withWhitespace: Bool = false, textAnchor: String?, fill: Fill?, stroke: Stroke?, opacity: Double, fontName: String?, fontSize: Int?, fontWeight: String?, bounds: Rect) -> Text? {
+    fileprivate func parseTspan(_ tspan: XMLIndexer, withWhitespace: Bool = false, textAnchor: String?, fill: Fill?, stroke: Stroke?, opacity: Double, fontName: String?, fontSize: Int?, fontWeight: String?, bounds: Rect, previousCollectedTspan: Node?) -> Text? {
 
         guard let element = tspan.element else {
             return .none

            weight: getFontWeight(attributes) ?? fontWeight ?? "normal")
    }

    fileprivate func getTspanPosition(_ element: SWXMLHash.XMLElement, bounds: Rect, withWhitespace: inout Bool) -> Transform {
        var xPos: Double
        var yPos: Double

        if let absX = getDoubleValue(element, attribute: "x") {
            xPos = absX
            withWhitespace = false
        } else if let relX = getDoubleValue(element, attribute: "dx") {
            xPos = bounds.x + bounds.w + relX
        } else {
            xPos = bounds.x + bounds.w
        }

        if let absY = getDoubleValue(element, attribute: "y") {
            yPos = absY
        } else if let relY = getDoubleValue(element, attribute: "dy") {
            yPos = bounds.y + relY
        } else {
            yPos = bounds.y
        }
        return Transform.move(dx: xPos, dy: yPos)
    }



        let string = element.text
        var shouldAddWhitespace = withWhitespace
        let pos = getTspanPosition(element, bounds: bounds, previousCollectedTspan: previousCollectedTspan, withWhitespace: &shouldAddWhitespace)
        let text = shouldAddWhitespace ? " \(string)" : string
        let attributes = getStyleAttributes([:], element: element)

