The data is in the original eco-markdown text, and now you want to read to the browse page? How to render?
First into HTML format, then to the terminal page?
or directly put markdown text on the front page, and then use the JS rendering function to render the formatted text.
Either way, the user is sure to see the formatted text, but the first way to see the page source code should be all HTML, and the second method to see the source code to see the main content should be markdown text, rather than HTML text
Which method is good? Only consider reading from the database to the front-end display this process (I use Bootstrap-markdown)
Reply content:
The data is in the original eco-markdown text, and now you want to read to the browse page? How to render?
First into HTML format, then to the terminal page?
or directly put markdown text on the front page, and then use the JS rendering function to render the formatted text.
Either way, the user is sure to see the formatted text, but the first way to see the page source code should be all HTML, and the second method to see the source code to see the main content should be markdown text, rather than HTML text
Which method is good? Only consider reading from the database to the front-end display this process (I use Bootstrap-markdown)
The rendering process is done to the front end ...
In, Typecho
it is PHP
displayed to the user after rendering.
In fact, the use of JS rendering or background language rendering, are optional.
The most important thing is that it depends on the specific problem and function.
As simple as a blog, the use of these two are not much of a relationship.
You understand the problem. Browsers can be rendered, or can be rendered, must be in line with the content of the specification: HTML,CSS
Markdown content, the browser can not understand, you need to use MD's analytic library, the content of the MD, the browser needs to change the label and style.
For example, the "# # Title" in Markdown is "
", the display effect is this:
Title
The parsing library is about your MD text "# Title", which translates into a browser-understandable label "
"
So what you need is a markdown analytic library, such as: Parsedown.
The second, with the first how do you modify?
Only preserve the markdown format, you can parse the output or use JS parsing can
Search before asking questions.
A certain degree and Google can come out dozens of pages of results.
Second, you can search the community first. This question is about to be asked Rotten.
Refer to another question on this site:
http://segmentfault.com/q/1010000004113131