Closed freephile closed 2 years ago
The file argument obviously needs to be normalized to 'raw' so we can parse the markdown. See line 36 of EmbedUseCase.php
However, the render method in line 58 should probably use a different variant of the normalize routine for content.
Or, looking at more of the code, it looks like UrlExpander.php could be modified with a different $baseUrl, or deeper down in the MarkdownRender.php class where $contentUrl is passed.
I created a KH page from bitbucket using the following URL: https://git.pega.io/projects/PS/repos/rulebase-service/browse/README.md Notice browse in the URL.
When importing, all relative links on the page have been replaced with links to bitbucket, but to their raw instead of browse format. So the import created links like this: https://git.pega.io/projects/PS/repos/rulebase-service/raw/README.md Notice raw in the URL.
As a consequence, while the imported .md file renders nicely, following any link leads to raw, unformatted pages. Would it be possible to convert relative links to absolute using the same prefix as in the imported URL (or default to 'browse')?