The drawing support for inline code and pre block is already built in. We should add a toolbar action that would handle these actions. The expected behaviour is:
Inline code from selection
Select a word in a sentence
Click on <> icon
The word gets highlighted with the <code> inline annotation
The <> icon gets highlighted
Click on the <> icon again
The icon is not highlighted any more
The word is no longer highlighted
Block code from selection
Select a block of text (multiple spans)
Click on the <> icon
The block of text gets highlighted with the <pre><code> block annotation
Add a line
The new line is still within the block (the behaviour is similar to quote
Click on <> icon again
The highlighting is now removed
Block code from cursor position
Move the cursor into a paragraph
Click on the <> icon
The paragraph is converted to <pre><code> block
Click on the <> again
The paragraph is converted back and the code block is removed
Block code from cursor position on an empty line
Move the cursor on an empty line
Click on the <> icon
The line is converted to <pre><code> block
Click on the <> again
The line is converted back and the code block is removed
The drawing support for inline
code
andpre
block is already built in. We should add a toolbar action that would handle these actions. The expected behaviour is:Inline code from selection
<>
icon<code>
inline annotation<>
icon gets highlighted<>
icon againBlock code from selection
<>
icon<pre><code>
block annotationquote
<>
icon againBlock code from cursor position
<>
icon<pre><code>
block<>
againBlock code from cursor position on an empty line
<>
icon<pre><code>
block<>
again