convert node/id to node/path-alias in content body
I found a hook in Pathologic module as hook_pathologic_alter and I used it to convert node path to URL alias. 

I used this hook as follows

/**
 * Implements hook_pathologic_alter().
 */
function mymodule_pathologic_alter(&amp;$url_params, &amp;$parts, &amp;$cached_settings){
    if ($parts['path'] != '&lt;front&gt;') {

        //get the alias for the path and assign it in path
        $alias = \Drupal::service('path.alias_manager')-&gt;getAliasByPath('/'.$url_params['path']);

        //Url::fromUri which Pathologic uses need a path without slash at first, so trim it
        $url_params['path'] = ltrim($alias, '/');
    }
}


This converts a node path to alias and pass it, so Pathologic will form a URL with alias.