Description
Replace CRLF, lone CR, and LF in content with single spaces.
Text positions can be measured in UTF-16 code units, Unicode code points, grapheme clusters, or modeled display columns. These coordinates are not interchangeable. Invisible markers and delimiter policies can also affect interpretation even when a string looks unchanged, so the chosen representation needs to stay explicit.
Replace CRLF, lone CR, and LF in content with single spaces.
When to use this tool
Use Markdown Code Span Edge Space Rule when you need the stated marker, coordinate, delimiter, or normalization operation under an explicit text representation.
How to use the tool and how it works
- Enter content. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read content, trimmed. Inspect trimmed before interpreting the associated values.
Replace CRLF, lone CR, and LF in content with single spaces. If the result starts and ends with a space and contains a non-space character, remove exactly one space from each end and set trimmed.1
CommonMark code-span content replaces line endings with spaces and conditionally removes one space from each edge.2
| Input field | Meaning and units | Accepted input |
|---|---|---|
| content | Content | Required. Text; maximum UTF-16 length 8192. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| content | Content | Required. Text; maximum UTF-16 length 8192. |
| trimmed | Whether exactly one ASCII edge space was removed from each side. | Required. Boolean. |
{
"input": {
"content": " code "
},
"output": {
"content": "code",
"trimmed": true
}
} Limitations and assumptions
- All-space content is preserved. This implements a code-span content-normalization term without locating delimiters, parsing Markdown blocks, or changing tabs and other whitespace.
- The field tables state structural bounds; the mechanics also specify cross-field constraints. Malformed inputs and unsupported domains cause errors. A successful false flag, empty branch value, or zero placeholder has the meaning stated above and is distinct from an input error.
Alternative or Complementary methods
Choose the coordinate system required by the consumer. Use a full parser, renderer, or segmentation method when a local marker or delimiter rule cannot determine the complete text behavior.
References
-
Calculation and input contract: text/markdown-code-span-edge-space-rule — tool.io
-
CommonMark 0.31.2, 6.1: Code Spans — John MacFarlane
Similar or alternative tools
- Markdown Inline Code Fence Length
Return a backtick fence one character longer than the longest backtick run in code, with a minimum length of one and a maximum returned length of 8192.
- Inline Code Backtick Run Padding
Add one ASCII space at both edges of code when it starts or ends with a backtick, or has spaces at both ends while containing a non-space character.