As a dynamic web site in the construction process inevitably encountered the issue of online editing articles. HTML provides a TEXTAREA tag, but does not actually solve the problem, since textarea is plain text. Unless you use HTML tags when you type, you will get a piece of text that has no structure from beginning to end. Constructing a kind of WYSIWYG online editor through DHTML in Web design is a good solution to this problem.
But what you see is not the only solution. In the process of surfing the Internet, I found that some portal online editors are very special. It's not WYSIWYG (but it provides a preview), but it's a textarea text field, but it doesn't support HTML markup language. Instead, it has its own set of markup languages.
图1
图2
The author felt very fluent, summed up its advantages as follows:
First, it's not many tags, compared to the HTML is very simple, and by carriage return can automatically generate paragraphs, easy to be accepted by the general user. The author thinks that if the Chinese tag is used, it can be accepted by more domestic users.
Second, compared to WYSIWYG editor, users can master their own article structure, generate less garbled.
Third, visibility is much better than HTML, plus the preview feature is better.
Four, because their markup language does not support scripting, so it is more secure.
After the author of some thinking and practice, is to build this kind of their own markup language method of publicity:
First, we identify a simple and necessary markup language for our website. Make sure that you omit some unnecessary. For my part, I identified the markup language for my website as follows:
[picture] The URL of the picture [/Picture]
[Big Title] text content [/headline]
[small title] text content [/small title] (considering the user may be subdivided so plus)
[Bold] text content [/bold]
[Italic] text content [/italic]
[link] url [/link]
Then, provide a mechanism for the browser to read our tags. So, how do we get browsers to read our own identified tags? On the page where the content is displayed, we need to write a program that translates all of our markup into standard HTML tags, but it has to filter out the HTML code that the user has entered before.