Quantcast
Channel: XWiki Forum - Latest topics
Viewing all articles
Browse latest Browse all 1369

Introduce a way for macros to indicate that they don't support standalone mode

$
0
0

Hi everyone,

we have certain macros like mentions or footnotes, for which it just doesn’t make any sense to use them in standalone mode - it would be totally surprising for a user to insert them in the WYSIWYG editor and then not to be able to insert text in the same line before or after them.

I would therefore suggest introducing a way for macros to indicate that they don’t support standalone mode similar to how macros can already indicate that they don’t support inline mode.

There are several options for this:

  1. Duplicate what we have for supportsInlineMode as supportsStandaloneMode, at least the part in the macro descriptor and in the wiki macro descriptor. The default would be true for this new property.
  2. Refactor the macro descriptor and the wiki macro definition to have a set of supported modes with inline and standalone as possible values and deprecate the existing supportsInlineMode methods. Of course, there would be backwards compatibility code to ensure that the existing methods still work, which might be a bit complex to support all possibilities.

I propose the following consequences when a macro is marked as supporting inline mode only:

  1. Ensure that CKEditor always inserts such macros as inline, similar to the existing inline: enforce property.
  2. Before the macro transformation executes such a macro, if the macro is marked as standalone, the macro is wrapped in a paragraph.

Do you have any opinions on this, in particular related to how this property should be stored?

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 1369

Trending Articles