Skip to content

[#74710] add wiki page link macro plugin#115

Merged
Kharonus merged 3 commits into
masterfrom
feature/74710-render-macro-in-ckeditor-editing-mode
May 19, 2026
Merged

[#74710] add wiki page link macro plugin#115
Kharonus merged 3 commits into
masterfrom
feature/74710-render-macro-in-ckeditor-editing-mode

Conversation

@Kharonus
Copy link
Copy Markdown
Member

@Kharonus Kharonus commented May 8, 2026

Ticket

#74710

What are you trying to accomplish?

  • insert turbo frames for wiki page link macros in the editing view

What approach did you choose and why?

  • add upcast and downcast conversions
  • add parsing function to data prozessor

Related PR

opf/openproject#23142

@Kharonus Kharonus requested review from a team and oliverguenther May 8, 2026 14:39
@Kharonus Kharonus self-assigned this May 8, 2026
@Kharonus Kharonus force-pushed the feature/74710-render-macro-in-ckeditor-editing-mode branch from 5ae9844 to 005a5eb Compare May 8, 2026 14:39
const pageIdentifier = match[3];

const frameId = crypto.randomUUID();
const frameSrc = `/wiki_page_link_macro/load?provider_id=${providerId}&page_identifier=${pageIdentifier}&turbo_frame_id=${frameId}`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This URL will fail on a relative URL root. Please use the pathHelperService from the core instead of building a path manually. You can access it from the plugin context

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to change a bit in the constructor of the data processor plugin to get the editor context in. Any ideas of doing this less intrusively?

'turbo-frame',
{
id: frameId,
src: `/wiki_page_link_macro/load?provider_id=${providerId}&page_identifier=${pageIdentifier}&turbo_frame_id=${frameId}`,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, see above.

Comment thread .editorconfig
Comment thread src/commonmark/commonmarkdataprocessor.js Outdated
Comment thread src/commonmark/commonmarkdataprocessor.js Outdated
Comment thread src/commonmark/commonmarkdataprocessor.js Outdated
Comment thread src/commonmark/commonmarkdataprocessor.js Outdated
Base automatically changed from chore/docker-dev-ready to master May 12, 2026 13:27
- https://community.openproject.org/work_packages/74710
- add upcast and downcast conversions
- add parsing function to data prozessor
- use path helper for frame src url
@Kharonus Kharonus force-pushed the feature/74710-render-macro-in-ckeditor-editing-mode branch from 1c0cc72 to 5a469f5 Compare May 12, 2026 13:30
@Kharonus Kharonus force-pushed the feature/74710-render-macro-in-ckeditor-editing-mode branch from 54294fd to 8506bff Compare May 12, 2026 14:02
@NobodysNightmare
Copy link
Copy Markdown

Now that I was able to test it locally, I found weird cursor movement behaviour:

Screencast.from.2026-05-18.09-29-02.webm

At first I am pressing arrow up and down and as you can see, the list item is completely skipped. After I click at the corresponding line, I get a cursor inside the element and I can move the cursor left and right properly. Trying to use up/down afterwards leads to skipping again...

@NobodysNightmare
Copy link
Copy Markdown

NobodysNightmare commented May 18, 2026

One more issue: Switching to markdown source view and then back to WYSIWYG, breaks with the error message

unexpected-error Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-unexpected-error Original error: TypeError: can't access property "isEnabled", o2 is undefined

Video:

Screencast.from.2026-05-18.09-38-05.webm

If needed for reproduction, this is my WP description:

Some proposal for the source code:

```text
<html>
  <body>
  	<h1>My Open source conference</h1>
  </body>
</html>
```

A good example website is [https://nur-jan.de](https://nur-jan.de/)

This is in preparation for ###9. But also relates to ###10, ###11 and ###12.

This is what Wiki links might look like some day: \[\[\[2:8\]\]\], unless they are missing: \[\[\[42:123\]\]\] (no provider) / \[\[\[2:1337\]\]\] (no page)

They can also be used in a list:

*   \[\[\[3:some-identifier\]\]\]
    

The following is not an OpenProject link to XWiki, but if you click it, you might believe that and expose your XWiki access token to me: [Totally a link to an XWiki page](https://xwiki.dev.nur-jan.de/oidc/authorization?response_type=code&client_id=banana_split&redirect_uri=https://nur-jan.de/exfiltrate_data_quickly) (please click it and confirm).

@Kharonus
Copy link
Copy Markdown
Member Author

To the first issue:
I have no solution for that, it behaves the same for the work package macros

To the second:
I do not think, that this is related to the new wiki macros. I get this error in fully empty descriptions too.

@Kharonus Kharonus merged commit d13d3a6 into master May 19, 2026
4 checks passed
@Kharonus Kharonus deleted the feature/74710-render-macro-in-ckeditor-editing-mode branch May 19, 2026 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants