diff --git a/rasa/nlu/training_data/formats/markdown.py b/rasa/nlu/training_data/formats/markdown.py
index e87b58dfb35..17715581b06 100644
--- a/rasa/nlu/training_data/formats/markdown.py
+++ b/rasa/nlu/training_data/formats/markdown.py
@@ -27,6 +27,22 @@ item_regex = re.compile(r"\s*[-*+]\s*(.+)")
 comment_regex = re.compile(r"<!--[\s\S]*?--!*>", re.MULTILINE)
 fname_regex = re.compile(r"\s*([^-*+]+)")
 
+ESCAPE_DCT = {"\b": "\\b", "\f": "\\f", "\n": "\\n", "\r": "\\r", "\t": "\\t"}
+
+ESCAPE = re.compile(r"[\b\f\n\r\t]")
+
+
+def encode_string(s):
+    """Return a encoded python string
+
+    """
+
+    def replace(match):
+        return ESCAPE_DCT[match.group(0)]
+
+    return ESCAPE.sub(replace, s)
+
+
 logger = logging.getLogger(__name__)
 
 
@@ -258,17 +274,17 @@ class MarkdownWriter(TrainingDataWriter):
     def _generate_section_header_md(section_type, title, prepend_newline=True):
         """generates markdown section header."""
         prefix = "\n" if prepend_newline else ""
-        return prefix + "## {}:{}\n".format(section_type, title)
+        return prefix + "## {}:{}\n".format(section_type, encode_string(title))
 
     @staticmethod
     def _generate_item_md(text):
         """generates markdown for a list item."""
-        return "- {}\n".format(text)
+        return "- {}\n".format(encode_string(text))
 
     @staticmethod
     def _generate_fname_md(text):
         """generates markdown for a lookup table file path."""
-        return "  {}\n".format(text)
+        return "  {}\n".format(encode_string(text))
 
     def _generate_message_md(self, message):
         """generates markdown for a message object."""

Converting from JSON to Markdown writes newlines
Having a `\n` in the text of an intent example works for JSON, but when we use `rasa.nlu.convert` to dump to Markdown, this prints newlines, which splits the example in two at train time
diff --git a/data/test/json_with_special_chars_convered_to_md.md b/data/test/json_with_special_chars_convered_to_md.md
new file mode 100644
index 00000000000..60433f35015
--- /dev/null
+++ b/data/test/json_with_special_chars_convered_to_md.md
@@ -0,0 +1,10 @@
+## intent:affirm
+- yes\n
+
+## intent:restaurant_search
+- i'm looking for a place in the [n\north\n](location) of town
+
+## synonym:chinese
+- C\thi\rne\bs
+- chines
+- Chinese
diff --git a/data/test/training_data_containing_special_chars.json b/data/test/training_data_containing_special_chars.json
new file mode 100644
index 00000000000..e16261c86ef
--- /dev/null
+++ b/data/test/training_data_containing_special_chars.json
@@ -0,0 +1,33 @@
+{
+  "rasa_nlu_data": {
+    "common_examples": [
+      {
+        "text": "yes\n",
+        "intent": "affirm"
+      },
+      {
+        "entities": [
+          {
+            "start": 31, 
+            "end": 38,
+            "value": "n\north\n",
+            "entity": "location"
+          }
+        ], 
+        "intent": "restaurant_search\t",
+        "text": "i'm looking for a place in the n\north\n of town"
+      }
+    ], 
+    "entity_synonyms": [
+      {
+        "synonyms": [
+          "C\thi\rne\bs",
+          "chines", 
+          "Chinese"
+        ], 
+        "value": "chinese"
+      }
+    ], 
+    "regex_features": []
+  }
+}
\ No newline at end of file
diff --git a/tests/nlu/base/test_training_data.py b/tests/nlu/base/test_training_data.py
index cdb3e243fb5..07f36edf385 100644
--- a/tests/nlu/base/test_training_data.py
+++ b/tests/nlu/base/test_training_data.py
@@ -396,6 +396,12 @@ def cmp_dict_list(firsts, seconds):
             "md",
             None,
         ),
+        (
+            "data/test/training_data_containing_special_chars.json",
+            "data/test/json_with_special_chars_convered_to_md.md",
+            "md",
+            None,
+        ),
     ],
 )
 def test_training_data_conversion(

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-localserver pytest-sanic responses freezegun nbsphinx aioresponses moto
apt-get update apt-get install -y gcc
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
absl-py==1.4.0
aiofiles==0.8.0
aiohttp==3.5.4
aioresponses==0.7.6
alabaster==0.7.13
anyio==3.6.2
APScheduler==3.6.0
astor==0.8.1
async-generator==1.10
async-timeout==3.0.1
attrs==22.2.0
Babel==2.11.0
backports.zoneinfo==0.2.1
bleach==4.1.0
boto3==1.15.18
botocore==1.18.18
cached-property==1.5.2
certifi==2021.5.30
cffi==1.15.1
chardet==3.0.4
charset-normalizer==3.0.1
click==7.1.2
colorclass==2.2.0
coloredlogs==10.0
colorhash==1.0.2
ConfigArgParse==0.15.2
contextvars==2.4
coverage==6.2
cryptography==40.0.2
cycler==0.11.0
dataclasses==0.8
decorator==5.1.1
defusedxml==0.7.1
docopt==0.6.2
docutils==0.15.2
entrypoints==0.4
fakeredis==1.0.3
fbmessenger==6.0.0
Flask==1.1.4
Flask-Cors==3.0.10
freezegun==1.2.2
future==0.18.3
gast==0.6.0
gevent==1.4.0
greenlet==2.0.2
grpcio==1.48.2
h11==0.12.0
h5py==3.1.0
httpcore==0.14.7
httptools==0.6.0
httpx==0.22.0
humanfriendly==10.0
idna==2.8
idna-ssl==1.1.0
imagesize==1.4.1
immutables==0.19
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
ipython-genutils==0.2.0
itsdangerous==1.1.0
Jinja2==2.11.3
jmespath==0.10.0
jsonpickle==1.1
jsonschema==2.6.0
jupyter-client==7.1.2
jupyter-core==4.9.2
jupyterlab-pygments==0.1.2
kafka-python==1.4.6
Keras-Applications==1.0.8
Keras-Preprocessing==1.1.2
kiwisolver==1.3.1
Markdown==3.3.7
MarkupSafe==2.0.1
matplotlib==3.0.3
mattermostwrapper==2.1
mistune==0.8.4
mock==5.2.0
moto==4.0.13
multidict==4.7.6
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nbsphinx==0.8.8
nest-asyncio==1.6.0
networkx==2.3
numpy==1.16.3
packaging==19.2
pandocfilters==1.5.1
pika==1.0.1
pluggy==1.0.0
prompt-toolkit==2.0.10
protobuf==3.19.6
psycopg2-binary==2.8.2
py==1.11.0
pycparser==2.21
pydot==1.4.1
Pygments==2.14.0
PyJWT==2.4.0
pykwalify==1.7.0
pymongo==3.8.0
pyparsing==3.1.4
PySocks==1.7.1
pytest==7.0.1
pytest-cov==4.0.0
pytest-localserver==0.9.0.post0
pytest-sanic==1.7.1
python-crfsuite==0.9.10
python-dateutil==2.8.0
python-engineio==4.11.2
python-socketio==4.0.1
python-telegram-bot==11.1.0
pytz==2019.1
pytz-deprecation-shim==0.1.0.post0
PyYAML==6.0.1
pyzmq==25.1.2
questionary==1.1.1
-e git+https://github.com/RasaHQ/rasa.git@07e2b5def944d146c5786f6d35ea23313c55ce04#egg=rasa
rasa-sdk==1.0.0
redis==3.2.1
requests==2.22.0
requests-toolbelt==1.0.0
responses==0.17.0
rfc3986==1.5.0
rocketchat-API==0.6.31
ruamel.yaml==0.15.94
s3transfer==0.3.7
sanic==19.3.1
Sanic-Cors==0.9.8
sanic-jwt==1.3.1
Sanic-Plugins-Framework==0.9.5
scikit-learn==0.20.2
scipy==1.2.1
simple-websocket==1.1.0
simplejson==3.16.0
six==1.17.0
sklearn-crfsuite==0.3.6
slackclient==1.3.1
sniffio==1.2.0
snowballstemmer==2.2.0
sortedcontainers==2.4.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
SQLAlchemy==1.3.24
tabulate==0.8.10
tensorboard==1.13.1
tensorflow==1.13.1
tensorflow-estimator==1.13.0
termcolor==1.1.0
terminaltables==3.1.0
testpath==0.6.0
tomli==1.2.3
tornado==6.1
tqdm==4.31.0
traitlets==4.3.3
twilio==6.26.3
typing_extensions==4.1.1
tzdata==2025.2
tzlocal==4.2
ujson==4.3.0
urllib3==1.24.3
uvloop==0.14.0
wcwidth==0.2.13
webencodings==0.5.1
webexteamssdk==1.1.1
websocket-client==0.54.0
websockets==6.0
Werkzeug==1.0.1
wsproto==1.0.0
xmltodict==0.14.2
yarl==1.7.2
zipp==3.6.0

name: rasa
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - absl-py==1.4.0
      - aiofiles==0.8.0
      - aiohttp==3.5.4
      - aioresponses==0.7.6
      - alabaster==0.7.13
      - anyio==3.6.2
      - apscheduler==3.6.0
      - astor==0.8.1
      - async-generator==1.10
      - async-timeout==3.0.1
      - attrs==22.2.0
      - babel==2.11.0
      - backports-zoneinfo==0.2.1
      - bleach==4.1.0
      - boto3==1.15.18
      - botocore==1.18.18
      - cached-property==1.5.2
      - cffi==1.15.1
      - chardet==3.0.4
      - charset-normalizer==3.0.1
      - click==7.1.2
      - colorclass==2.2.0
      - coloredlogs==10.0
      - colorhash==1.0.2
      - configargparse==0.15.2
      - contextvars==2.4
      - coverage==6.2
      - cryptography==40.0.2
      - cycler==0.11.0
      - dataclasses==0.8
      - decorator==5.1.1
      - defusedxml==0.7.1
      - docopt==0.6.2
      - docutils==0.15.2
      - entrypoints==0.4
      - fakeredis==1.0.3
      - fbmessenger==6.0.0
      - flask==1.1.4
      - flask-cors==3.0.10
      - freezegun==1.2.2
      - future==0.18.3
      - gast==0.6.0
      - gevent==1.4.0
      - greenlet==2.0.2
      - grpcio==1.48.2
      - h11==0.12.0
      - h5py==3.1.0
      - httpcore==0.14.7
      - httptools==0.6.0
      - httpx==0.22.0
      - humanfriendly==10.0
      - idna==2.8
      - idna-ssl==1.1.0
      - imagesize==1.4.1
      - immutables==0.19
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - ipython-genutils==0.2.0
      - itsdangerous==1.1.0
      - jinja2==2.11.3
      - jmespath==0.10.0
      - jsonpickle==1.1
      - jsonschema==2.6.0
      - jupyter-client==7.1.2
      - jupyter-core==4.9.2
      - jupyterlab-pygments==0.1.2
      - kafka-python==1.4.6
      - keras-applications==1.0.8
      - keras-preprocessing==1.1.2
      - kiwisolver==1.3.1
      - markdown==3.3.7
      - markupsafe==2.0.1
      - matplotlib==3.0.3
      - mattermostwrapper==2.1
      - mistune==0.8.4
      - mock==5.2.0
      - moto==4.0.13
      - multidict==4.7.6
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nbsphinx==0.8.8
      - nest-asyncio==1.6.0
      - networkx==2.3
      - numpy==1.16.3
      - packaging==19.2
      - pandocfilters==1.5.1
      - pika==1.0.1
      - pluggy==1.0.0
      - prompt-toolkit==2.0.10
      - protobuf==3.19.6
      - psycopg2-binary==2.8.2
      - py==1.11.0
      - pycparser==2.21
      - pydot==1.4.1
      - pygments==2.14.0
      - pyjwt==2.4.0
      - pykwalify==1.7.0
      - pymongo==3.8.0
      - pyparsing==3.1.4
      - pysocks==1.7.1
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pytest-localserver==0.9.0.post0
      - pytest-sanic==1.7.1
      - python-crfsuite==0.9.10
      - python-dateutil==2.8.0
      - python-engineio==4.11.2
      - python-socketio==4.0.1
      - python-telegram-bot==11.1.0
      - pytz==2019.1
      - pytz-deprecation-shim==0.1.0.post0
      - pyyaml==6.0.1
      - pyzmq==25.1.2
      - questionary==1.1.1
      - rasa-sdk==1.0.0
      - redis==3.2.1
      - requests==2.22.0
      - requests-toolbelt==1.0.0
      - responses==0.17.0
      - rfc3986==1.5.0
      - rocketchat-api==0.6.31
      - ruamel-yaml==0.15.94
      - s3transfer==0.3.7
      - sanic==19.3.1
      - sanic-cors==0.9.8
      - sanic-jwt==1.3.1
      - sanic-plugins-framework==0.9.5
      - scikit-learn==0.20.2
      - scipy==1.2.1
      - simple-websocket==1.1.0
      - simplejson==3.16.0
      - six==1.17.0
      - sklearn-crfsuite==0.3.6
      - slackclient==1.3.1
      - sniffio==1.2.0
      - snowballstemmer==2.2.0
      - sortedcontainers==2.4.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - sqlalchemy==1.3.24
      - tabulate==0.8.10
      - tensorboard==1.13.1
      - tensorflow==1.13.1
      - tensorflow-estimator==1.13.0
      - termcolor==1.1.0
      - terminaltables==3.1.0
      - testpath==0.6.0
      - tomli==1.2.3
      - tornado==6.1
      - tqdm==4.31.0
      - traitlets==4.3.3
      - twilio==6.26.3
      - typing-extensions==4.1.1
      - tzdata==2025.2
      - tzlocal==4.2
      - ujson==4.3.0
      - urllib3==1.24.3
      - uvloop==0.14.0
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - webexteamssdk==1.1.1
      - websocket-client==0.54.0
      - websockets==6.0
      - werkzeug==1.0.1
      - wsproto==1.0.0
      - xmltodict==0.14.2
      - yarl==1.7.2
      - zipp==3.6.0
prefix: /opt/conda/envs/rasa

tests/nlu/base/test_training_data.py::test_training_data_conversion[data/test/training_data_containing_special_chars.json-data/test/json_with_special_chars_convered_to_md.md-md-None]
[ tests/nlu/base/test_training_data.py::test_example_training_data_is_valid tests/nlu/base/test_training_data.py::test_validation_is_throwing_exceptions[invalid_data0] tests/nlu/base/test_training_data.py::test_validation_is_throwing_exceptions[invalid_data1] tests/nlu/base/test_training_data.py::test_validation_is_throwing_exceptions[invalid_data2] tests/nlu/base/test_training_data.py::test_validation_is_throwing_exceptions[invalid_data3] tests/nlu/base/test_training_data.py::test_luis_data tests/nlu/base/test_training_data.py::test_wit_data tests/nlu/base/test_training_data.py::test_dialogflow_data tests/nlu/base/test_training_data.py::test_lookup_table_json tests/nlu/base/test_training_data.py::test_lookup_table_md tests/nlu/base/test_training_data.py::test_demo_data[data/examples/rasa/demo-rasa.json] tests/nlu/base/test_training_data.py::test_demo_data[data/examples/rasa/demo-rasa.md] tests/nlu/base/test_training_data.py::test_train_test_split[data/examples/rasa/demo-rasa.md] tests/nlu/base/test_training_data.py::test_data_merging[files0] tests/nlu/base/test_training_data.py::test_data_merging[files1] tests/nlu/base/test_training_data.py::test_markdown_single_sections tests/nlu/base/test_training_data.py::test_repeated_entities tests/nlu/base/test_training_data.py::test_multiword_entities tests/nlu/base/test_training_data.py::test_nonascii_entities tests/nlu/base/test_training_data.py::test_entities_synonyms tests/nlu/base/test_training_data.py::test_training_data_conversion[data/examples/wit/demo-flights.json-data/test/wit_converted_to_rasa.json-json-None] tests/nlu/base/test_training_data.py::test_training_data_conversion[data/examples/luis/demo-restaurants.json-data/test/luis_converted_to_rasa.json-json-None] tests/nlu/base/test_training_data.py::test_training_data_conversion[data/examples/dialogflow/-data/test/dialogflow_en_converted_to_rasa.json-json-en] tests/nlu/base/test_training_data.py::test_training_data_conversion[data/examples/dialogflow/-data/test/dialogflow_es_converted_to_rasa.json-json-es] tests/nlu/base/test_training_data.py::test_training_data_conversion[data/examples/rasa/demo-rasa.md-data/test/md_converted_to_json.json-json-None] tests/nlu/base/test_training_data.py::test_training_data_conversion[data/examples/rasa/demo-rasa.json-data/test/json_converted_to_md.md-md-None] tests/nlu/base/test_training_data.py::test_url_data_format tests/nlu/base/test_training_data.py::test_markdown_entity_regex tests/nlu/base/test_training_data.py::test_get_file_format
rasa/nlu/training_data/formats/markdown.py
rasa/nlu/training_data/formats/markdown.py