package cmarkit
Module Inline.Code_spanSource
Code spans.
The type for code spans.
make ~backtick_count code_layout is a code span with given parameters.
Warning. Nothing is made to ensure correctness of the data, use of_string to compute the right amount of backticks.
of_string s is a code span for s. s can start with or include backticks; the appropriate minimal backtick count and possible needed leading and trailing space are computed accordingly. If s contains newlines, blanks after newlines are treated as layout like during parsing. meta is used for the lines of the resulting code layout (see code_layout).
backtick_count cs is the number of delimiting backticks.
code cs computes from code_layout the code in the span cs.
code_layout cs is the code data in a form that allows layout preservation.
The actual code data is the tight block lines concatenated and separated by space and if the result starts and ends with a space and is not only made of spaces, these should be dropped. The code function does all that for you.