In the entry of English test questions, because English questions often have similar questions as follows:
My friend watches dragon Boat races at the Dragon boat Festival. (Ask a question in the dash section)
--_______ is the Double ninth Festival?
--it is in October.
In the above topic, we need to look for a rich text editor capable of editing the underline, and in order to speed up the editing, can be used in the entry of the question of several patterns are often predefined, such as the--,_____ symbol of the automatic input.
After a survey on the Internet, we found that BOOTSTRAP-WYSIWYG can meet our needs.
This control can be found from HTTPS://GITHUB.COM/STEVEATHON/BOOTSTRAP-WYSIWYG (the latest version).
In the bootstrap-wysiwyg/examples/html-editor.html official example, you can find the relevant HTML editor to use.
In this official example, when downloaded down will be found not to use, mainly the lack of jquery.hotkeys.js and google-code-prettify/src/prettify.js, these JS can be from https://github.com/ Obtained in mindmup/bootstrap-wysiwyg/tree/master/external.
The specific use of this control rules is relatively simple, this article is no longer simple to repeat, the specific can refer to the official website of the use of instructions, no few lines of code can be simple to use, the reader can try to see for themselves.
In order to achieve the click of a button can automatically output the predefined template text, the specific implementation of the following:
<a class= "btn btn-default" data-edit= "inserttext ____" title= "" ><i class= "fa fa-align-justify" > </i></a>
In the simple code above, the InsertText command is used mainly in the Data-edit attribute, which can be followed by the relevant text parameters.
The complete command can be consulted: https://developer.mozilla.org/en-US/docs/Web/API/document/execCommand#Commands
Bootstrap Rich Text editor-BOOTSTRAP-WYSIWYG