Data Converter icon

Data Converter

Convert between various data formats - Base64, Binary, JSON, XML, YAML, CSV, HTML, and more

Overview

This node performs various string transformations and data format conversions. Specifically, for the String resource with the Remove Code Block Markers operation, it removes Markdown-style code block markers (e.g., triple backticks orlanguage) from a given text input. This is useful when you want to clean up text extracted from Markdown documents or chat messages that include code blocks, leaving only the raw code or content without the formatting markers.

Practical examples:

  • Cleaning user-submitted code snippets before further processing or storage.
  • Preparing text for display in environments where Markdown formatting is not supported.
  • Extracting pure code content from Markdown files or chat logs.

Properties

Name Meaning
Input Data The text input containing code block markers to be removed.
Binary Property Name (Optional) Name for the output binary property if binary output is enabled (not used here).

Output

The node outputs a JSON object with a single field:

  • result: A string containing the input text with all Markdown code block markers removed.

Example output JSON:

{
  "result": "console.log('Hello World');"
}

No binary data output is involved in this operation.

Dependencies

  • No external services or API keys are required.
  • The node uses internal utility functions for string manipulation.
  • No special environment variables or n8n configurations are needed.

Troubleshooting

  • Input missing or empty: If the input text does not contain any code block markers, the output will be identical to the input.
  • Unexpected characters remain: Ensure the input text uses standard Markdown code block markers (triple backticks). Other types of code delimiters may not be removed.
  • Error messages: Errors are unlikely unless the input is not a string. If an error occurs, verify that the "Input Data" property is correctly set and contains valid text.

Links and References

Discussion