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

   https://issues.apache.org/jira/browse/JSPWIKI-492
   
   `TextUtil.cleanString` keeps letters, digits and the characters of 
`PUNCTUATION_CHARS_ALLOWED`. The superscript digits are neither letters nor 
digits for `Character.isLetterOrDigit`, so `MarkupParser.cleanLink` removed 
them: `Metre²` became `Metre` when a page was referred to by a link, although a 
page saved under that name exists.
   
   `PUNCTUATION_CHARS_ALLOWED` now also holds `¹`, `²` and `³` (as unicode 
escapes). `LEGACY_CHARS_ALLOWED`, used by `wikifyLink`, is not changed. The 
report is about `²` and `³`; I did not look at other characters.
   
   `LuceneSearchProvider` also reads `PUNCTUATION_CHARS_ALLOWED`: it replaces 
those characters by spaces in the raw page name that it indexes, so the 
superscripts are handled there like the other characters of the constant. I did 
not run a search over a page with such a name.
   
   Tests: `TextUtilTest.testCleanStringKeepsSuperscriptDigits` and 
`MarkupParserTest.testCleanLinkKeepsSuperscriptDigits` fail on master 
(`expected: <Metre²> but was: <Metre>`) and pass with the change. 
`TextUtilTest`, `MarkupParserTest`, `SearchManagerTest` and 
`JSPWikiMarkupParserTest` pass on the branch. I did not run the whole test 
suite.


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