diff --git a/htdocs/import/leap/lib.php b/htdocs/import/leap/lib.php index 23bcccc..4ee40b1 100644 --- a/htdocs/import/leap/lib.php +++ b/htdocs/import/leap/lib.php @@ -980,6 +980,9 @@ class PluginImportLeap extends PluginImport { private function fix_artefact_reference($field) { $ns = $this->namespaces[$this->leap2anamespace]; + // add a wrapper div, just so simpleXML doesn't get confused. + $field = "
$field
"; + // load the field as XML $dom = new DOMDocument('1.0', 'utf-8'); $dom->loadHTML($field); @@ -1033,7 +1036,10 @@ class PluginImportLeap extends PluginImport { // DOMDocument wraps the content with '' // so we call children() twice to remove it again - return $xml->children()->children()->asXML(); + $result = $xml->children()->children()->asXML(); + // strip off the containing div we added above + $result = substr($result, strlen('
'), -strlen('
')); + return $result; } private function _fixref($hrefsrc) {