Page MenuHomePhabricator

Unable to insert newline in code blocks
Closed, InvalidPublic


To reproduce:

  1. Select Computer code from the text style menu.
  2. Write something
  3. Press enter.

Actual result:
A new line is started outside the code block.

Expected result:
A new line is started within the same code block. Pressing enter a second time, without writing anything, should probably close the code block.

More information:
This also happens when text containing newlines is pasted.

Event Timeline

The text style menu is for inline text styles, not block level items. The <code> tag in HTML which this inserts is inline only. For multi-line code blocks you are better off using the syntax highlight extension: Insert-> Code block.

In may be possible to detect a user apply code style to multiple lines and direct them to the extension if it is installed.

Thanks @Esanders, I didn't know about code blocks. This helped me to do what I wanted.

I don't really understand your second comment, but as far as I'm concerned, this can be closed as invalid.