Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a view-files macro before a block macro in the rich text editor adds its result as content in the page #305

Open
lucaa opened this issue Jul 27, 2024 · 2 comments

Comments

@lucaa
Copy link

lucaa commented Jul 27, 2024

How to reproduce:

  • on a page, add a block macro, e.g. info:
{{info}}test{{/info}}
  • open this page in the rich text editor
  • position the caret before the info box (using the red newline button of the editor to create a new line)
  • insert a view-file macro, either using the quick actions menu or using the insert macro menu
  • select or not a file to view, depending on how the macro was added it may or may not be asked for
  • save page

Expected result:

  • the content of the page is made of 2 macro calls, a view-file macro call and the info macro

Actual result

  • there are the 2 macro calls in the page content, but there is also some content as wiki syntax between the 2, which represents the display of the view file macro:
{{view-file/}}

(% class="box errormessage" %)
(((
rendering.macro.viewFile.namerequired"
)))

{{html}}
<span class="viewFileThumbnail viewFileThumbnailButton"  data-preview="false" data-ref="xwiki:Sandbox.TestPage1@filename">
<a href="/xwiki/bin/download/Sandbox/TestPage1/filename"
download="download"
 class="button button-primary" title="View file content"
>
  <span class="attachmentMimeType" data-type="">
                                                                                  <span title="Attachment"><span class="fa fa-paperclip" aria-hidden="true"></span></span>
      </span>

<span class="viewFileName">filename</span>
</a>
</span>
{{/html}}

{{info}}
test
{{/info}}

Note: it happens the same if I fill in an actual file in the view-file macro.

Reproduced on Chrome, on XWiki 16.4.1, may be a new issue related to the version of XWiki.

@lucaa
Copy link
Author

lucaa commented Jul 27, 2024

Note: this reproduces also if I add a view-file macro before another view-file macro.

@lucaa
Copy link
Author

lucaa commented Jul 27, 2024

tested with Pro macros 1.19.9 on XWiki 16.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant