Markdown relative media url problem

I’m using markdown editor in my template like in this issue: https://getgrav.org/forum#!/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 %}
  <h2>
    Requirements
  </h2>
  <p>
    {{position.requirements|markdown}}
  </p>

  {{ 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">
          {{position.position}}
        </p>
        <p class="position-location">{{position.location}}</p>
      </div>
      <div class="position-details collapsed">

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

      </div>
    </div>
  {% 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

![](P1100338mini.jpg)

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 http://127.0.0.1:8888/mywebsite/user/pages/06.career/_05_open-positions/super-boy/P1100338mini.jpg
but page.header.position.requirements image path is resolved to http://127.0.0.1:8888/mywebsite/career/P1100338mini.jpg

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.