When you insert a YouTube URL to a confluence page, it gets replaced by the YouTube macro within a second. Also, the URL will be but as paramter of the macro.
When you insert a Jira URL (of a application linked Jira), it gets replaced by the Jira macro within a second. Also, the parameters are set automatically.
How can I achieve this with my own User Macro?
I want a specifiy URL (linke https://foo.net/bar) to always get transformed to my Foo macro.
We've investigated it previously and looks like it is implemented not by macros, but by Confluence editor, which based on TinyMCE. So the editor has some predefined hooks on text insert and replaces some text patterns to macros on the fly.
We've found a workaround with a custom event listener for "Page Created" and "Page Updated" events which replaces our URL patterns to macros. Of course, a user will not see the changes right after inserting some text but the proper macro will be on a page after saving.
Thanks for the answer, Gergor!
Unfortunately, this workaround is not a real nice solution :/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.