cancel
Showing results for 
Search instead for 
Did you mean: 

Behavior of the <code> tag

danny_lacerte2
Participant
0 Kudos
181

Hello!

I was testing how sharing of code snippets would look like under the new blogging platform, so here what I wrote :

In the text editor, I used the <code> tag around my code:

But then I switched to the visual editor and it looked like this. Only the first paragraph was shown in the code font:

Switching back to the text editor, the <code> tag changed to contain only the first paragraph:

Is this the expected behavior for the <code> tag?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Danny,

I ran two tests for code snippets.

One worked and the other didn't.

Here's the first -->https://blogs.sap.com/2016/05/27/test-code-snippet/

Here's the second -->https://blogs.sap.com/2016/05/27/test-code-snippet-part-2/ (didn't work)

To make it work, I didn't use the text editor, I used the standard default visual editor.

I typed in first line of text.

Then copied my code.

Then selected my code and used the shortcut key shift-alt-x and it changed the code.

Let me know if this is what you were looking for.

with kind regards,

Bill

danny_lacerte2
Participant
0 Kudos

I didn't try the keyboard shortcuts.

It automatically puts <code></code> on each line, so I guess that's how it's intended to be used instead of large blocks of text.

Thank you very much!

Answers (0)