Skip to content

Commit

Permalink
XWIKI-22673: Syntax [[...]] in terminal page breaks rendering and ind…
Browse files Browse the repository at this point in the history
…exing of content

(cherry picked from commit 358cc4c)
  • Loading branch information
tmortagne committed Nov 21, 2024
1 parent 738001c commit 8699732
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ protected DocumentReference resolveDocumentReference(EntityReference sourceRefer
new SpaceReference(reference.getName(), (SpaceReference) reference.getParent());
finalReference = new DocumentReference(defaultDocumentName, spaceReference);

if (trySpaceSibling
if (sourceReference != null && trySpaceSibling
&& trySpaceSiblingFallback(sourceReference, finalReference, baseReference, defaultDocumentName)) {
// Try as a space sibling.
DocumentReference siblingReference =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ public void resolveUntypeDocument() throws ComponentLookupException
assertEquals(new DocumentReference(CURRENT_WIKI, CURRENT_SPACE, PAGE),
this.mocker.getComponentUnderTest().resolve(documentResource(PAGE, false), null));

// When the reference cannot be parsed by the relative resolver

assertEquals(
new DocumentReference(CURRENT_WIKI,
Arrays.asList(CURRENT_SPACE, CURRENT_SPACE, CURRENT_SPACE, CURRENT_PAGE), DEFAULT_PAGE),
this.mocker.getComponentUnderTest().resolve(documentResource("...", false), null));

// When the page is current page

assertEquals(new DocumentReference(CURRENT_WIKI, CURRENT_SPACE, CURRENT_PAGE),
Expand Down

0 comments on commit 8699732

Please sign in to comment.