enonic / lib-guillotine

Apache License 2.0
3 stars 0 forks source link

processHtml is not supported on TextComponent #198

Closed espen42 closed 2 years ago

espen42 commented 2 years ago

When querying on an item that has a region with a text component, and that text component has an image embedded, the image url does not contain the domain (e.g. localhost:8080) even when processed with processHtml:{type:absolute}:

    query($path:ID!) {                     
          guillotine {
            get(key:$path) {
              displayName
              _path
              components {
            text {
              value(processHtml:{type:absolute}) {
                processedHtml
              }
            }
          }
        }
      }
    }

--->

{
  "data": {
    "guillotine": {
      "get": {
        "displayName": "Persons",
        "_path": "/hmdb/persons",
        "components": [
          {
            "text": null
          },
          {
            "text": null
          },
          {
            "text": {
              "value": {
                "processedHtml": "<p>Hoi<br />\n&nbsp;</p>\n\n<figure class=\"editor-align-justify\"><img alt=\"Lea-Seydoux.jpg\" src=\"/admin/site/preview/hmdb/draft/hmdb/_/image/09b3af0e-6da3-4bcf-88d9-11cbe9c41283:e1738c655c27bae3f1323e48916e49165f958239/width-768/Lea-Seydoux.jpg\" data-image-ref=\"7c33386c-eb75-494a-880c-9e16d4d520d3\" style=\"width:100%\" />\n<figcaption></figcaption>\n</figure>\n\n<p>&nbsp;</p>\n"
              }
            }
          }
        ]
      }
    }
  }
}

Needed: src=\"localhost:8080/admin/site/preview/hmdb/draft/hmdb/_/image/09b3af0e-6da3-4bcf-88d9-11cbe9c41283:e1738c655c27bae3f1323e48916e49165f958239/width-768/Lea-Seydoux.jpg\"