major
nice-to-have
minor
Currently, the WYSIWYG editor can insert code snippets, but these are always displayed as blocks. Individual words cannot be displayed as code within a line.
Improvement
With the help of the CodeTag plugin, an additional button for inline code is now available in the editor. This button wraps the selected text in <code class="inlineCode"></code>. The inlineCode class prevents the code from being displayed as a block. Code mode can also be activated using the keyboard shortcut CTRL+Q.\\
\\
Usage
To make the new plugin available in the WYSIWYG editor, it must be configured accordingly.
Enable the Inline Code and Code Snippet plugin: {{{#!xml <config service-class="com.top_logic.layout.wysiwyg.ui.StructuredTextConfigService">
<instance class="com.top_logic.layout.wysiwyg.ui.StructuredTextConfigService">
<feature-sets>
<feature-set name="html">
<feature-ref name="syntaxhighlighting" />
</feature-set>
</feature-sets>
</instance>
</config> }}}
Enables only the inline code plugin: {{{#!xml <config service-class="com.top_logic.layout.wysiwyg.ui.StructuredTextConfigService">
<instance class="com.top_logic.layout.wysiwyg.ui.StructuredTextConfigService">
<features>
<feature name="inlinecode">
<property key="toolbar">
<list>
<struct>
<property key="name">
<string value="basicstyles" />
</property>
<property key="items">
<list>
<string value="InlineCode" />
</list>
</property>
</struct>
</list>
</property>
<property key="extraPlugins">
<list>
<string value="inlinecode" />
</list>
</property>
</feature>
</features>
<feature-sets>
<feature-set name="html">
<feature-ref name="inlinecode" />
</feature-set>
</feature-sets>
</instance>
</config> }}}
Test
In the WYSIWYG editor (e.g., under Structures > A > Type Demo > HTML), switch to edit mode and enter some text. Select the text and click the new button. The new text should now be displayed as code (you may need to exit edit mode so that the highlighter displays the text correctly). If you select the text again, you should be able to remove the code tags by clicking the new button once more, and the text will be displayed normally again. Test this as well using the keyboard shortcut CTRL+Q.