Answer the question
In order to leave comments, you need to log in
How to store Makdown text in MySQL?
Hello!
Actually a subject.
A field in MySQL is of type TEXT. How can I store Makdown markup in this field?
When simply writing text, paragraphs are lost, i.e. instead of
This text is a paragraph.
This won't be another paragraph, it will join the line above it.
This will be another paragraph, as it has a blank line above it.
This text is a paragraph. This won't be another paragraph, it will join the line above it. This will be another paragraph, as it has a blank line above it.
bror a line break character.
Answer the question
In order to leave comments, you need to log in
MySQL itself would hardly lose line breaks in a cell of type TEXT. Most likely you have a problem with saving/displaying data on the PHP side. Please provide code on how you save/display data
Markdown is a text format. Means as the text and to save.
Where did you lose the newlines - mysql has nothing to do with it. What they told him to write down, he will write it down, and then he will read it. Maybe you yourself delete line breaks before recording, maybe after. It can be trite to output to a format that is immune to line breaks, for example, in HTML.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question