Strip leading / for absolute wiki link paths
Change-Id: Ic475d570a3438916cd952d317338df1756c8be5a
| | |
| | | public Rendering render(WikiLinkNode node) {
|
| | | try {
|
| | | String fsc = GitBlit.getString(Keys.web.forwardSlashCharacter, "/");
|
| | | String path = URLEncoder.encode(node.getText().replace(' ', '-'), "UTF-8").replace("%2F", fsc);
|
| | | // adjust the request path
|
| | | String path = node.getText().charAt(0) == '/' ? node.getText().substring(1) : node.getText();
|
| | | path = URLEncoder.encode(path.replace(' ', '-'), "UTF-8").replace("%2F", fsc);
|
| | |
|
| | | // extract document name
|
| | | String name = node.getText();
|
| | | String name = node.getText().replace('_', ' ');
|
| | | if (name.indexOf('/') > -1) {
|
| | | name = name.substring(name.lastIndexOf('/') + 1);
|
| | | }
|