Resolve image relative paths
What does this MR do?
This MR adds a mechanism to resolve relative paths for images.
Note: This is the final MR towards delivering #218531 (closed)
Screenshots (strongly suggested)
WYSIWYG
Test data:
In the following scenarios, I used the following data for mounts
:
mounts = [
{
source: 'default/source/',
target: '',
},
{
source: 'source/with/target',
target: 'target',
},
];
Scenarios:
Given the mounts data above, assuming that we're on the master branch and that we're testing locally, URLs are generated as follows:
Markdown URL | WYSIWYG URL |
---|---|
http://localhost/absolute/path/to/image.png |
http://localhost/absolute/path/to/image.png |
/relative/path/to/image.png |
http://localhost/user1/project1/-/raw/master/default/source/relative/path/to/image.png |
/target/image.png |
http://localhost/user1/project1/-/raw/master/source/with/target/image.png |
relative/to/current/image.png |
http://localhost/user1/project1/-/raw/master/relative/to/current/image.png |
relative/to/current/image.png |
http://localhost/user1/project1/-/raw/master/relative/to/current/image.png |
./relative/to/current/image.png |
http://localhost/user1/project1/-/raw/master/./relative/to/current/image.png |
../relative/to/current/image.png |
http://localhost/user1/project1/-/raw/master/../relative/to/current/image.png |
Does this MR meet the acceptance criteria?
Conformity
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
Related to #218531 (closed)
Edited by Jacques Erasmus