Repository navigation
JSPWIKI-492 Allow the superscript digits in page names - #573
Open
arturobernalg wants to merge 3 commits into
Open
arturobernalg wants to merge 3 commits into
arturobernalg wants to merge 3 commits into
Conversation
arturobernalg
force-pushed
the
bug/JSPWIKI-492
branch
from
November 3, 2026 19:37
9402e75 to
313de2c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/JSPWIKI-492
TextUtil.cleanStringkeeps letters, digits and the characters ofPUNCTUATION_CHARS_ALLOWED. The superscript digits are neither letters nor digits forCharacter.isLetterOrDigit, soMarkupParser.cleanLinkremoved them:Metre²becameMetrewhen a page was referred to by a link, although a page saved under that name exists.PUNCTUATION_CHARS_ALLOWEDnow also holds¹,²and³(as unicode escapes).LEGACY_CHARS_ALLOWED, used bywikifyLink, is not changed. The report is about²and³; I did not look at other characters.LuceneSearchProvideralso readsPUNCTUATION_CHARS_ALLOWED: it replaces those characters by spaces in the raw page name that it indexes. A page saved asMetre²is found byMetre,name:Metre*andMetre², on master and with this change;SearchManagerTest.testTitleSearchWithSuperscriptDigitcovers it.Tests:
TextUtilTest.testCleanStringKeepsSuperscriptDigitsandMarkupParserTest.testCleanLinkKeepsSuperscriptDigitsfail on master (expected: <Metre²> but was: <Metre>) and pass with the change.TextUtilTest,MarkupParserTest,SearchManagerTestandJSPWikiMarkupParserTestpass on the branch. I did not run the whole test suite.