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

   When a page with blanks in its name is renamed and the referrers are 
updated, DefaultPageRenamer keeps the old name as the text of the link, so 
[Test Page] becomes [Test Page|Foo Test]. That is intended. The same rule was 
also applied to the target of a link that already had a text, which added a 
third part. Renaming the page a second time gave [Test Page|Foo Test|Bar Test] 
instead of [Test Page|Bar Test], which is the report in JSPWIKI-1162. A link 
such as [Alpha|Test Page] already became [Alpha|Test Page|Foo Test] at the 
first rename.
   
   The rule now only applies when the name is also the text of the link. In the 
other cases the target is replaced.
   
   Names without blanks, such as CamelCase names, were not affected, and the 
existing tests for renaming twice use such names, which is why they did not 
catch it.
   
   Not changed: an anchor stays in the text, so [Test Page#Anchor] becomes 
[Test Page#Anchor|Foo Test] at the first rename and the second rename replaces 
the target. A link written with different upper and lower case, such as [test 
page], is still not renamed.
   
   Tests: 3 new cases in PageRenamerTest (renaming twice with blanks, with an 
anchor, and a link with a text and a target with blanks). They fail without the 
change, with the output above, and pass with it. The jspwiki-util, 
jspwiki-event and jspwiki-main suites pass.


-- 
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