Getting relative paths for linked resources in articles



  • Greg - Community Manager
    Comment actions Permalink

    Hi Matthias Hahn! Good question, I had to do some digging myself to find the answer here.

    When you're making a call directly through the API, we don't have any method to return a relative will just return the verbatim content of the body of the article. Interestingly enough, if you make this change directly in our UI, our HTML sanitizer will strip out the hostname from the URL. That doesn't help in your situation though, it's just a confirmation that that behavior would lead to a good outcome, which is why we do it.

    So, to summarize, there is no way to pull the relative path from the API. However, what you could do is run a bit of regex in between the GET from the source article, strip out the "", and then on the POST/PUT to create/update the translated article, you would pass in your newly created relative path.

    I know that isn't the easy answer that I would have liked to give you, but I hope it gets you moving in the right direction. Let me know if you have any questions about this!

  • Matthias Hahn
    Comment actions Permalink

    Thanks Greg - Community Manager, I was hoping for a different answer but I'm already working on a regex solution...


Please sign in to leave a comment.

Powered by Zendesk