arturobernalg opened a new pull request, #537:
URL: https://github.com/apache/jspwiki/pull/537

   https://issues.apache.org/jira/browse/JSPWIKI-1192
   
   An image attached to a page did not render in a Markdown page, neither with 
Markdown image syntax nor with the JSPWiki link syntax.
   
   Two things were wrong. `![alt](Page/pic.png)` is a flexmark `Image` node, 
and the JSPWiki link extension only handled `Link` nodes, so the `src` stayed 
`Page/pic.png` and the browser resolved it against the current URL. 
`[alt](Page/pic.png)` was converted to an inline image, but 
`LocalLinkNodePostProcessorState` and `LocalLinkAttributeProviderState` passed 
the attachment name instead of its URL as the image source. The wiki syntax 
parser already converts the name with `PAGE_ATTACH` before it builds the image.
   
   `JSPWikiLinkNodePostProcessor` now also handles `Image` nodes and points the 
ones that refer to an attachment to the attachment URL, and the two link states 
pass the attachment URL as the image source.
   
   `MarkdownRendererTest.testAttachedImageSyntax` and `testInlineAttachedImage` 
fail without the change (`src="Test/pic.png"`) and pass with it 
(`src="/test/attach/Test/pic.png"`). The test suites of `jspwiki-main` and 
`jspwiki-markdown` pass.
   
   I did not look at the editor autocomplete that inserts the `![` snippet, 
which lives in the JavaScript of the editor. This change only covers how the 
resulting Markdown is rendered.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to