[ 
https://issues.apache.org/jira/browse/JSPWIKI-1057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18134361#comment-18134361
 ] 

Arturo Bernal commented on JSPWIKI-1057:
----------------------------------------

Reproduced with the current code (upstream master) on a running instance 
(Tomcat 10.1), reading the HTML of the page. I used the two examples of the 
report: the SET line for url.wiki, a numbered line with the link written as in 
the report, and a preformatted block with the wget line.

The numbered item reads Browse to, then the first variable left as it was 
written, then a bar, then the address with the closing bracket. So the first 
variable is not replaced and the second one is, as in the report. In the 
preformatted block the variable is not replaced either, it stays as written. 
The first case follows from the double opening bracket, which in JSPWiki is the 
escape for a literal bracket, so the link is not parsed and the variable inside 
it is not reached; the report asks for the variables to be replaced before the 
links are parsed.

I did not look at what that change would affect in the order of the steps of 
the parser, and I did not try other variables. I did not look for a 
configuration flag for backwards compatibility like the one the report 
suggests. Leaving the issue open.

> Variable substitution priority
> ------------------------------
>
>                 Key: JSPWIKI-1057
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-1057
>             Project: JSPWiki
>          Issue Type: Bug
>    Affects Versions: 2.10.2
>            Reporter: Dave Jarvis
>            Priority: Major
>
> *Replicate*
> Create a wiki page as follows:
> {code}
> [{SET url.wiki='https://jspwiki-wiki.apache.org/'}]
> # Browse to [[{$url.wiki}]|[{$url.wiki}]].
> {code}
> *Expected Results*
> 1. Browse to [https://jspwiki-wiki.apache.org].
> *Actual Results*
> 1. Browse to {{\[{$url.wiki}]|https://jspwiki-wiki.apache.org]}}.
> *Additional Information*
> Variable substitution should take place prior to formatting text. For 
> backwards compatibility, this could be a configuration flag.
> *Related*
> Create a wiki page as follows:
> {code}
> [{SET url.wiki='https://jspwiki-wiki.apache.org/'}]
> {{{
>   wget [{$url.wiki}]wiki
> }}}
> {code}
> This does not produce the desired result because formatting takes precedence 
> over variable substitution.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to