Mark - code

Purpose

The code mark is intended to be applied to text nodes to indicate code styling. Code styling is a distinct concept from monospace (mono) because:

  • user mentioning is not possible inside code
  • inserting emoji is not possible inside code
  • code does not allow other marks to be interspersed (e.g. bold / italic / links within code)
  • code is rendered with background decoration

Example

1
2
3
4
5
6
7
8
9
{
  "type": "text",
  "text": "Hello world",
  "marks": [
    {
      "type": "code"
    }
  ]
}

Fields

NameMandatoryTypeValueNotes
typestring"code"