Markdown relative media url problem

I’m using markdown editor in my template like in this issue:!/general:markdown-editor

My problem is that image linking (resolving relative path) is not working correctly when used from modular on collection pages.

Here is part of partial that I’m using:

{% set position = page.header.position %}

  {{ page.content }}

Here is how I call this partial from parent (modular) (*2):

{% for child in page.children %}
    {% set position = child.header.position %}
    <div class="position-container">
      <div class="position-summary" id="{{ position.anchor_id }}">
        <p class="position-name">
        <p class="position-location">{{position.location}}</p>
      <div class="position-details collapsed">

        {% include 'partials/position.html.twig' with {'page': child} %}

  {% endfor %}

You may wonder why I use partial - I need this part of code to be used as a list view and as a separate page.

I’m using following test markdown for both page.content and page.header.position.requirements:

some text


some text

So my problem is that when I use this solution for separate page everything works fine - both cases paths are resolved OK, but when I’m using it from modular template (*2) page.content links is resolved correctly but page.header.position.requirements links are resolved incorrectly (path used in page.header is resolved according to CURRENT PAGE url (not file system based but router based(?)).

Correct path to image is
but page.header.position.requirements image path is resolved to

Is there any way to give markdown filter argument with path to be used? Is there any way to set some global variable to set current working directory to one I want? Am I doing something terribly wrong? :slight_smile:

THANKS for any help.